Skip to main content
  <script src="https://js.moonkey.fun/sdk/dist/latest/streambird.js"></script>
  var streambird = MoonKey('pk_test_KJuRUZmh1XC342h1n39gH84MuSZDyD13NfhtDkaY6IfwpQA0H', {
    headless: false,
    showLoginEmailUI: true,
    showLoginWaitingUI: true,
    networkConfig: {
      rpcUrl: 'https://goerli.infura.io/v3/INFURA_API_KEY'
    },
  });
This reference documents every object and method available in the MoonKey browser-side JavaScript library. You can use MoonKey SDK to initiate direct API calls with our SDK public API that accepts a PublicToken. For example, you can initiate email magic link and OAuth all via the SDK using PublicToken. This is also very useful for Web3 focused applications that might not want to implement their own backends to handle user verification using our secret ApiKey.

Setup

To load the MoonKey Javascript SDK directly, you can load MoonKey.js directly in your document header. If you prefer to use MoonKey.js as a module, we provide an npm package that allows you to load MoonKey JS SDK directly into your project’s npm pipeline. Refer to our GitHub repo here. To Get started with MoonKey JS, use MoonKey(publicToken, options) to create an instance of the MoonKey object. This will be your entrypoint to the rest of the MoonKey Javascript SDK. If you use React, refer to the React SDK Reference. Your publicToken is required when calling this function since it identifies your App to MoonKey. We will be prefilling example with a sample test PublicToken, pk_test_KJuRUZmh1XC342h1n39gH84MuSZDyD13NfhtDkaY6IfwpQA0H. You should replace it with your own PublicToken under API Keys -> Public.

Methods

publicToken
string
required
Publishable API Key that identifies your App.
options
MoonKeyClientOptions Object