@worksheets/sdk
v0.0.12
Published
> Stop integrating APIs and SDKs. Start integrating APPs.
Downloads
2
Readme
Introduction
Stop integrating APIs and SDKs. Start integrating APPs.
Worksheets.dev is a low-code integration platform built for developers to integrate applications into their code without having to learn the APIs or SDKs of those applications.
Features
- Static typesafety for all applications and their inputs and outputs
- No more dependency hell, use one light-weight SDK for all applications.
- Instant analytics and insights for your application usage on Worksheets.dev
SDK Quick Start
- For a full guide on getting started with Worksheets.dev, check out our Getting Started Guide
Requirements
- This SDK requires a Worksheets.dev account and API Key.
- No credit card required.
- All new users get 100 free daily executions.
- Node.js v16 or higher.
- TypeScript v5.0 or higher.
Usage
- Install the SDK
npm install @worksheets/sdk
- Import the SDK
import { newRegistry } from '@worksheets/sdk';
- Create a new Registry
const registry = newRegistry({
credentials: {
apiKey: 'API_KEY_FROM_WORKSHEETS.DEV',
},
});
- Create an instance of the application you want to use
// note: some applications require credentials or metadata
const openai = registry.openai({ apiKey: 'YOUR_API_KEY' });
// note: you must manage your own OAuth tokens
const gmail = registry.gmail({ accessToken: 'OAUTH_ACCESS_TOKEN' });
- Execute the method
// note: full typesafety for all inputs and outputs
const result = await openai.createCompletion({
// data payload
});
- Handle exceptions
import { Failure } from '@worksheets/sdk';
// ...
const math = registry.math();
try {
const result = await math.calc({ op: '/', x: 0, y: 0 });
console.log(result);
} catch (error) {
if (error instanceof Failure) {
// "[400] BAD_REQUEST: Cannot divide by zero"
console.log(error.message);
// 400
console.log(error.code);
// BAD_REQUEST
console.log(error.reason);
console.log(error.data);
console.log(error.cause);
console.log(error.stack);
}
}
- Monitor your application usage and analytics on Worksheets.dev
Examples
Find sample code and examples on our doc site
Applications
View all applications available and their inputs and outputs in our Application Gallery
Support
Join our discord community for support and feedback
Or reach out to us via our contact methods on our website https://docs.worksheets.dev