UNPKG

@codesandbox/api

Version:
35 lines (26 loc) 738 B
# @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 ```ts 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 ```ts import { createQuery, createMutation } from "@codesandbox/api"; const sandboxQuery = createQuery("Sandbox", { sandbox: [{ sandboxId: "new" }, { isFrozen: true }], }); ```