Skip to content

Commit bea370e

Browse files
committed
feat: add @thirdweb-dev/nebula package.
1 parent 70e024f commit bea370e

File tree

15 files changed

+5763
-5
lines changed

15 files changed

+5763
-5
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"storybook:react": "turbo run storybook --filter=./packages/*",
1717
"prefix": "pnpm dlx sherif@latest -i remark-gfm -i eslint --fix",
1818
"fix": "turbo run fix",
19-
"wallet-ui": "turbo run dev --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
20-
"wallet-ui:build": "turbo run build --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
21-
"playground": "turbo run dev --filter=./apps/playground-web --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
19+
"wallet-ui": "turbo run dev --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
20+
"wallet-ui:build": "turbo run build --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
21+
"playground": "turbo run dev --filter=./apps/playground-web --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
2222
"playground:build": "turbo run build --filter=./apps/playground-web",
23-
"portal": "turbo run dev --filter=./apps/portal --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
23+
"portal": "turbo run dev --filter=./apps/portal --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
2424
"portal:build": "turbo run build --filter=./apps/portal",
25-
"dashboard": "turbo run dev --filter=./apps/dashboard --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/vault-sdk --filter=./packages/engine",
25+
"dashboard": "turbo run dev --filter=./apps/dashboard --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/vault-sdk --filter=./packages/engine --filter=./packages/nebula",
2626
"dashboard:build": "turbo run build --filter=./apps/dashboard",
2727
"build": "turbo run build --filter=./packages/*",
2828
"build:release": "turbo run build --filter=./packages/* --force",

packages/nebula/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @thirdweb-dev/nebula

packages/nebula/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Nebula OpenAPI TypeScript wrapper
2+
3+
This package is a thin OpenAPI wrapper for Nebula, our AI agent service.
4+
5+
## Configuration
6+
7+
```ts
8+
import { configure } from "@thirdweb-dev/nebula";
9+
10+
// call this once at the startup of your application
11+
configure({
12+
secretKey: "<PROJECT_SECRET_KEY>",
13+
});
14+
```
15+
16+
You can also configure the client with a Thirdweb client instance:
17+
18+
```ts
19+
import { configureWithClient } from "@thirdweb-dev/nebula";
20+
import { twClient } from "./thirdwebClient";
21+
22+
// call this once at the startup of your application
23+
configureWithClient(twClient);
24+
```
25+
26+
## Example Usage
27+
28+
```ts
29+
import { getModels } from "@thirdweb-dev/nebula";
30+
31+
const models = await getModels();
32+
```
33+
34+
You can also use this package on a client application (eg. NextJS) by retrieving the Nebula API client first.
35+
36+
```ts
37+
import { getNebulaClient, getAgents } from "@thirdweb-dev/nebula";
38+
39+
// retrieve the Nebula auth token
40+
const nebulaClient = getNebulaClient(authToken);
41+
42+
// pass the client inside the methods
43+
const agentsResult = await getAgents({ client: nebulaClient });
44+
```
45+
46+
This package was autogenerated from the [Nebula openAPI spec](https://nebula-api.thirdweb.com/docs) using [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts)

packages/nebula/biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
3+
"extends": ["../../biome.json"]
4+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from "@hey-api/openapi-ts";
2+
3+
export default defineConfig({
4+
input: "https://nebula-api.thirdweb-dev.com/openapi.json",
5+
output: { path: "src/client", lint: "biome", format: "biome" },
6+
plugins: ["@hey-api/client-fetch"],
7+
});

packages/nebula/package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@thirdweb-dev/nebula",
3+
"version": "1.0.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/thirdweb-dev/js.git#main"
7+
},
8+
"license": "Apache-2.0",
9+
"bugs": {
10+
"url": "https://github.com/thirdweb-dev/js/issues"
11+
},
12+
"author": "thirdweb eng <[email protected]>",
13+
"type": "module",
14+
"main": "./dist/cjs/exports/thirdweb.js",
15+
"module": "./dist/esm/exports/thirdweb.js",
16+
"types": "./dist/types/exports/thirdweb.d.ts",
17+
"typings": "./dist/types/exports/thirdweb.d.ts",
18+
"exports": {
19+
".": {
20+
"types": "./dist/types/exports/thirdweb.d.ts",
21+
"import": "./dist/esm/exports/thirdweb.js",
22+
"default": "./dist/cjs/exports/thirdweb.js"
23+
},
24+
"./package.json": "./package.json"
25+
},
26+
"files": ["dist/*", "src/*"],
27+
"dependencies": {
28+
"@hey-api/client-fetch": "0.10.0",
29+
"thirdweb": "workspace:*"
30+
},
31+
"devDependencies": {
32+
"@hey-api/openapi-ts": "0.72.1",
33+
"rimraf": "6.0.1",
34+
"tslib": "^2.8.1"
35+
},
36+
"peerDependencies": {
37+
"typescript": ">=5.0.4"
38+
},
39+
"peerDependenciesMeta": {
40+
"typescript": {
41+
"optional": true
42+
}
43+
},
44+
"scripts": {
45+
"format": "biome format ./src --write",
46+
"lint": "biome check ./src",
47+
"fix": "biome check ./src --fix",
48+
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types",
49+
"build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
50+
"build:esm": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
51+
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
52+
"clean": "rimraf dist",
53+
"build:generate": "openapi-ts && pnpm format"
54+
},
55+
"engines": {
56+
"node": ">=18"
57+
}
58+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import {
4+
type Config,
5+
type ClientOptions as DefaultClientOptions,
6+
createClient,
7+
createConfig,
8+
} from "@hey-api/client-fetch";
9+
import type { ClientOptions } from "./types.gen.js";
10+
11+
/**
12+
* The `createClientConfig()` function will be called on client initialization
13+
* and the returned object will become the client's initial configuration.
14+
*
15+
* You may want to initialize your client this way instead of calling
16+
* `setConfig()`. This is useful for example if you're using Next.js
17+
* to ensure your client always has the correct values.
18+
*/
19+
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
20+
(
21+
override?: Config<DefaultClientOptions & T>,
22+
) => Config<Required<DefaultClientOptions> & T>;
23+
24+
export const client = createClient(
25+
createConfig<ClientOptions>({
26+
baseUrl: "https://nebula-api.thirdweb-dev.com",
27+
}),
28+
);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
export * from "./types.gen.js";
3+
export * from "./sdk.gen.js";

0 commit comments

Comments
 (0)