@codesandbox/api
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

@codesandbox/api

What still needs to be done

  • [ ] Write hook tests for GQL
  • [ ] Write hook tests for Rest
  • [ ] Provide WebSocket connection for GQL subscriptions
  • [ ] More documentation

Get started

import { CodeSandboxApi, onBrowserRequest } from "@codesandbox/api";

const api = new CodeSandboxApi({
  // Which endpoint to use
  development: true,
  // If it should start in an authenticated state, verifying
  // the user
  authenticate: true,
  // Callback for making requests
  onRequest: onBrowserRequest,
});

GQL queries

import { createQuery, createMutation } from "@codesandbox/api";

const sandboxQuery = createQuery("Sandbox", {
  sandbox: [{ sandboxId: "new" }, { isFrozen: true }],
});

Readme

Keywords

Package Sidebar

Install

npm i @codesandbox/api

Weekly Downloads

8

Version

1.1.3

License

MIT

Unpacked Size

698 kB

Total Files

108

Last publish

Collaborators

  • compuives
  • christianalfoni
  • alexnm
  • danilowoz