@cobaltio/cobalt-js
TypeScript icon, indicating that this package has built-in type declarations

8.5.2 • Public • Published

Cobalt Javascript SDK

Cobalt frontend SDK.

Install

npm

npm install @cobaltio/cobalt-js

yarn

yarn add @cobaltio/cobalt-js

Usage

Include

Browser

<!-- use a specific version -->
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@8.0.0"></script>
<!-- use a version range instead of a specific version -->
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@8"></script>
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@8.0"></script>
<!-- omit the version completely to use the latest one -->
<!-- you should NOT use this in production -->
<script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js"></script>

Node

import { Cobalt } from "@cobaltio/cobalt-js";

Initialize

// initialize with token
const cobalt = new Cobalt({
    // the token you generate for linked accounts using the cobalt backend SDK
    token: "COBALT_SESSION_TOKEN",
});

// Or, initialize without token
const cobalt = new Cobalt();
// and you can set the token later.
cobalt.token = "COBALT_SESSION_TOKEN";

Documentation

Read the SDK documentation here.

Package Sidebar

Install

npm i @cobaltio/cobalt-js

Weekly Downloads

268

Version

8.5.2

License

MIT

Unpacked Size

368 kB

Total Files

29

Last publish

Collaborators

  • subrat.1108
  • gocobalt