0.0.12 • Published 10 months ago

@worksheets/sdk v0.0.12

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Introduction

Stop integrating APIs and SDKs. Start integrating APPs.

SDK Example

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

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

  1. Install the SDK
npm install @worksheets/sdk
  1. Import the SDK
import { newRegistry } from '@worksheets/sdk';
  1. Create a new Registry
const registry = newRegistry({
  credentials: {
    apiKey: 'API_KEY_FROM_WORKSHEETS.DEV',
  },
});
  1. 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' });
  1. Execute the method
// note: full typesafety for all inputs and outputs
const result = await openai.createCompletion({
  // data payload
});
  1. 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);
  }
}
  1. 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

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago