CDN Links
Polybase DB Client
A client to connect to the Polybase DB decentralized database.
Install:
<script src = 'https://cdn.jsdelivr.net/npm/@polybase/client@latest/dist/bundle.min.js'></script>
Usage:
// Access methods with global variable 'polybase'
const db = new polybase.Polybase({
defaultNamespace: "your-namespace",
})
Polybase DB Auth
Allow users to sign in to your app using web3 wallets and web2 emails.
Install:
<script src = 'https://cdn.jsdelivr.net/npm/@polybase/auth@latest/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 DB Eth
A set of ethereum helpers based on EIP-1193, to make signing requests easier on Polybase DB.
Install:
<script src = 'https://cdn.jsdelivr.net/npm/@polybase/eth@latest/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 DB Util
A utility library to help support common Polybase DB utility functions.
Install:
<script src = 'https://cdn.jsdelivr.net/npm/@polybase/util@latest/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')