79 lines · 2.6 KB · Text
RawDownload
---title: Quickstartdescription: Create an Executor, add a source, and inspect its tools.--- import CreateExecutor from "/snippets/sdk/quickstart/create-executor.mdx";import AddIntegration from "/snippets/sdk/quickstart/add-integration.mdx";import CreateConnection from "/snippets/sdk/quickstart/create-connection.mdx";import ListTools from "/snippets/sdk/quickstart/list-tools.mdx";import InspectSchema from "/snippets/sdk/quickstart/inspect-schema.mdx";import CloseExecutor from "/snippets/sdk/quickstart/close-executor.mdx"; {/* Code snippets on this page are generated from examples/docs-sdk-quickstart/src/main.ts. */} The SDK lets you embed Executor in a TypeScript application. This quickstart creates an Executor, adds an OpenAPI integration from a local spec, connects a credential so the integration's tools appear, lists those tools, and inspects one tool schema. The snippets on this page are generated from a runnable example in `examples/docs-sdk-quickstart`. ## Install <CodeGroup> ```bash npmnpm install @executor-js/sdk @executor-js/plugin-openapi``` ```bash pnpmpnpm add @executor-js/sdk @executor-js/plugin-openapi``` ```bash yarnyarn add @executor-js/sdk @executor-js/plugin-openapi``` ```bash bunbun add @executor-js/sdk @executor-js/plugin-openapi``` </CodeGroup> ## Create An Executor Import the SDK and configure the plugins you want to expose. <CreateExecutor /> `onElicitation: "accept-all"` is convenient for scripts and examples. Applications with interactive approval flows should pass a handler instead. The `providers` you pass register where credential values are stored. A writable provider is required before you can create a connection with an inline value; this example uses a tiny in-memory store. ## Add An Integration An integration is the API surface. This example registers an OpenAPI document under the `inventory` slug and declares an apiKey authentication template — `variable("token")` marks where a connection's credential is placed on each request. <AddIntegration /> ## Create A Connection Tools are produced per connection. A connection is the saved credential for one integration; creating one with an inline `value` writes it to the default writable provider and yields the integration's tools. <CreateConnection /> ## List Tools After a connection is created, its tools appear in the unified tool catalog, keyed by `address`. <ListTools /> ## Inspect A Tool Tools expose schema metadata that agents and applications can use before invoking them. <InspectSchema /> ## Shut Down Close the Executor when your process is done with it. <CloseExecutor />