Welcome to opensdks
- a comprehensive suite of type-safe SDKs built on a unified runtime (@opensdks/runtime
). Our goal is to provide a simple, extensible, and delightful development experience.
- Installation: Start by installing the package in your project:
pnpm install
- Examples: For implementation examples, see
docs/example.ts
. - Existing SDKs: Browse the
sdks
directory for ready-to-use SDK adapters likesdk-apollo
,sdk-discord
,sdk-github
, andsdk-slack
.
Creating a new SDK adapter in opensdks
follows a standardized process, leveraging the existing structure of adapters like sdk-slack
.
-
Set Up Directory: Create a new directory for your SDK, for example,
sdk-openai
:mkdir sdk-openai
-
Prepare
package.json
: Copypackage.json
from an existing SDK and adjust it for your SDK. Key modifications include the package name and scripts for downloading and generating the OpenAPI spec. Remember to include dependencies like@opensdks/runtime
andopenapi-typescript
. -
Install Dependencies: Run:
pnpm install
-
Download and Generate OpenAPI Specs: Execute the download and generate scripts specified in
package.json
:pnpm run download pnpm run generate
-
Develop
index.ts
: Use an existing SDK'sindex.ts
as a template. Update the imports, types, and SDK definition to reflect your new SDK's functionality and structure. -
Testing Your SDK: Test your new SDK by writing a simple script that uses its functions, ensuring everything works as expected.
- OpenAPI Specifications: Ensure your SDK's OpenAPI spec is accurate and up-to-date.
- TypeScript Types: Update TypeScript types according to your SDK's specific requirements.
- Documentation: Document your SDK's functions and usage for ease of understanding.
By following these steps, you can seamlessly create and integrate new SDK adapters into opensdks
. For more detailed examples and guidance, refer to the existing SDKs in the sdks
folder.
Feel free to specify any particular aspects you'd like to be included or expanded upon in this README.
pnpm sync-manifests google
turbo run build --filter sdk-google
pnpm -r publish --no-git-checks