1. Guides
  2. CDN Links

Polybase Client

A client to connect to the Polybase decentralized database.

Install:

<script src = 'https://cdn.jsdelivr.net/npm/@polybase/[email protected]/dist/bundle.min.js'></script>

Usage:

// Access methods with global variable 'polybase'
const db = new polybase.Polybase({
  defaultNamespace: "your-namespace",
})

Polybase Auth

Allow users to sign in to your app using web3 wallets and web2 emails.

Install:

<script src = 'https://cdn.jsdelivr.net/npm/@polybase/[email protected]/dist/bundle.min.js'></script>

Usage:

// Access methods with global variable 'polybase'
const auth = new polybase_auth.Auth()

// Show the user the login modal
const state = await auth.signIn()

Polybase Eth

A set of ethereum helpers based on EIP-1193, to make signing requests easier on Polybase.

Install:

<script src = 'https://cdn.jsdelivr.net/npm/@polybase/[email protected]/dist/bundle.min.js'></script>

Usage:

// Access methods with global variable 'polybase_eth'
const data = 'Some data to be encrypted'
const address = '0xADDRESS_TO_ENCRYPT_WITH'
const encryptedData = polybase_eth.encrypt(data, address)

Polybase Util

A utility library to help support common Polybase utility functions.

Install:

<script src = 'https://cdn.jsdelivr.net/npm/@polybase/[email protected]/dist/bundle.min.js'></script>

Usage:

//Access methods with the global variable 'polybase_util'
const encodedString = '0xSOME_ENCODED_DATA'
const data = polybase_util.decodeFromString(encodedString, 'hex')