@collect.so/javascript-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.19.0 • Public • Published

Collect SDK

// lib/db.js
import Collect, { CollectModel } from '@collect.so/sdk'

const collect = new Collect(YOUR_API_TOKEN)

// Define your model schema
const TaskModel = new CollectModel({
    title: { type: 'string' },
    completed: { type: 'boolean', default: false }
})

// Register the model with the SDK
const TaskRepo = collect.registerModel('Task', TaskSchema)

// Create a new task
const newTask = await Task.create({title: 'Finish the report'})

// Find all completed tasks
const completedTasks = await Task.find({where: {completed: true}})

Readme

Keywords

none

Package Sidebar

Install

npm i @collect.so/javascript-sdk

Weekly Downloads

619

Version

0.19.0

License

MIT

Unpacked Size

221 kB

Total Files

98

Last publish

Collaborators

  • kumomix
  • 1px.one