osp-js
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

osp-js@1.12.9

osp-client-js is a osp clent js sdk.

Installation

Use the package manager [pnpm] or [npm] to install osp-client-js.

pnpm add osp-js

or

npm i osp-js

Usage

import { OspClient, Environment } from "osp-js";
import { ethers } from "ethers";

const env: Environment = Environment.dev;

const client = OspClient.create({
  env,
  storage: localStorage,
  app_id: "<APP_ID>",
  guest_id_marketing: "<GUEST_ID_MARKETING>",
});

const provider = new ethers.providers.Web3Provider(window.ethereum);
await provider.send("eth_requestAccounts", []);

await client.authentication.login(provider.getSigner());

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Readme

Keywords

none

Package Sidebar

Install

npm i osp-js

Weekly Downloads

10

Version

3.0.4

License

MIT

Unpacked Size

130 kB

Total Files

5

Last publish

Collaborators

  • kaibinluo
  • zhanxinxu
  • hamburgerguo
  • luomei
  • zhanxinxu-evg