Skip to content

feat: add @thirdweb-dev/nebula package. #7389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/vast-tires-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/nebula": minor
---

Initial release of the Nebula TS sdk
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
"build": "turbo run build --filter=./packages/*",
"build:release": "turbo run build --filter=./packages/* --force",
"changeset": "changeset",
"dashboard": "turbo run dev --filter=./apps/dashboard --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/vault-sdk --filter=./packages/engine",
"dashboard": "turbo run dev --filter=./apps/dashboard --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/vault-sdk --filter=./packages/engine --filter=./packages/nebula",
"dashboard:build": "turbo run build --filter=./apps/dashboard",
"e2e": "turbo run e2e --filter=./packages/*",
"fix": "turbo run fix",
"hotlink-init": "node ./scripts/hotlink/hotlink-init.mjs",
"hotlink-revert": "node ./scripts/hotlink/hotlink-revert.mjs",
"lint": "pnpm dlx sherif@latest -i remark-gfm -i eslint && turbo run lint",
"playground": "turbo run dev --filter=./apps/playground-web --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
"playground": "turbo run dev --filter=./apps/playground-web --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
"playground:build": "turbo run build --filter=./apps/playground-web",
"portal": "turbo run dev --filter=./apps/portal --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
"portal": "turbo run dev --filter=./apps/portal --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
"portal:build": "turbo run build --filter=./apps/portal",
"prefix": "pnpm dlx sherif@latest -i remark-gfm -i eslint --fix",
"preinstall": "npx only-allow pnpm",
Expand All @@ -75,8 +75,9 @@
"typedoc": "turbo run typedoc",
"version-packages": "changeset version",
"version-packages:nightly": "node scripts/pre-nightly.mjs && changeset version --snapshot nightly",
"wallet-ui": "turbo run dev --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine",
"wallet-ui:build": "turbo run build --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine"
"wallet-ui": "turbo run dev --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula",
"wallet-ui:build": "turbo run build --filter=./apps/wallet-ui --filter=./packages/thirdweb --filter=./packages/insight --filter=./packages/engine --filter=./packages/nebula"
},

"version": "1.0.0"
}
46 changes: 46 additions & 0 deletions packages/nebula/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Nebula OpenAPI TypeScript wrapper

This package is a thin OpenAPI wrapper for Nebula, our AI agent service.

## Configuration

```ts
import { configure } from "@thirdweb-dev/nebula";

// call this once at the startup of your application
configure({
secretKey: "<PROJECT_SECRET_KEY>",
});
```

You can also configure the client with a Thirdweb client instance:

```ts
import { configureWithClient } from "@thirdweb-dev/nebula";
import { twClient } from "./thirdwebClient";

// call this once at the startup of your application
configureWithClient(twClient);
```

## Example Usage

```ts
import { getModels } from "@thirdweb-dev/nebula";

const models = await getModels();
```

You can also use this package on a client application (eg. NextJS) by retrieving the Nebula API client first.

```ts
import { getNebulaClient, getAgents } from "@thirdweb-dev/nebula";

// retrieve the Nebula auth token
const nebulaClient = getNebulaClient(authToken);

// pass the client inside the methods
const agentsResult = await getAgents({ client: nebulaClient });
```

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)
4 changes: 4 additions & 0 deletions packages/nebula/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"extends": "//"
}
7 changes: 7 additions & 0 deletions packages/nebula/openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "@hey-api/openapi-ts";

export default defineConfig({
input: "https://nebula-api.thirdweb-dev.com/openapi.json",
output: { format: "biome", lint: "biome", path: "src/client" },
plugins: ["@hey-api/client-fetch"],
});
62 changes: 62 additions & 0 deletions packages/nebula/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "@thirdweb-dev/nebula",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "git+https://github.com/thirdweb-dev/js.git#main"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/thirdweb-dev/js/issues"
},
"author": "thirdweb eng <[email protected]>",
"type": "module",
"main": "./dist/cjs/exports/thirdweb.js",
"module": "./dist/esm/exports/thirdweb.js",
"types": "./dist/types/exports/thirdweb.d.ts",
"typings": "./dist/types/exports/thirdweb.d.ts",
"exports": {
".": {
"types": "./dist/types/exports/thirdweb.d.ts",
"import": "./dist/esm/exports/thirdweb.js",
"default": "./dist/cjs/exports/thirdweb.js"
},
"./package.json": "./package.json"
},
"files": [
"dist/*",
"src/*"
],
"dependencies": {
"@hey-api/client-fetch": "0.10.0",
"thirdweb": "workspace:*"
},
"devDependencies": {
"@biomejs/biome": "2.0.0",
"@hey-api/openapi-ts": "0.72.1",
"rimraf": "6.0.1",
"tslib": "^2.8.1"
},
"peerDependencies": {
"typescript": ">=5.0.4"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"scripts": {
"format": "biome format ./src --write",
"lint": "biome check ./src",
"fix": "biome check ./src --fix",
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types",
"build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
"build:esm": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"clean": "rimraf dist",
"build:generate": "openapi-ts && pnpm format"
},
"engines": {
"node": ">=18"
}
}
28 changes: 28 additions & 0 deletions packages/nebula/src/client/client.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// This file is auto-generated by @hey-api/openapi-ts

import {
type Config,
createClient,
createConfig,
type ClientOptions as DefaultClientOptions,
} from "@hey-api/client-fetch";
import type { ClientOptions } from "./types.gen.js";

/**
* The `createClientConfig()` function will be called on client initialization
* and the returned object will become the client's initial configuration.
*
* You may want to initialize your client this way instead of calling
* `setConfig()`. This is useful for example if you're using Next.js
* to ensure your client always has the correct values.
*/
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
(
override?: Config<DefaultClientOptions & T>,
) => Config<Required<DefaultClientOptions> & T>;

export const client = createClient(
createConfig<ClientOptions>({
baseUrl: "https://nebula-api.thirdweb-dev.com",
}),
);
4 changes: 4 additions & 0 deletions packages/nebula/src/client/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts

export * from "./sdk.gen.js";
export * from "./types.gen.js";
Loading
Loading