> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streambird.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

<RequestExample>
  ```javascript Including MoonKey JS theme={null}
    <script src="https://js.moonkey.fun/sdk/dist/latest/streambird.js"></script>
  ```
</RequestExample>

<ResponseExample>
  ```javascript Setup MoonKey SDK theme={null}
    var streambird = MoonKey('pk_test_KJuRUZmh1XC342h1n39gH84MuSZDyD13NfhtDkaY6IfwpQA0H', {
      headless: false,
      showLoginEmailUI: true,
      showLoginWaitingUI: true,
      networkConfig: {
        rpcUrl: 'https://goerli.infura.io/v3/INFURA_API_KEY'
      },
    });
  ```
</ResponseExample>

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](https://github.com/streambird/streambird-js).

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  <a href="react-sdk-reference">**React SDK Reference**</a>.

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

<ParamField body="publicToken" type="string" required>
  Publishable API Key that identifies your App.
</ParamField>

<ResponseField name="options" type="MoonKeyClientOptions Object">
  <Expandable title="attributes">
    <ResponseField name="headless" type="boolean">
      If enabled (true) there will be no default MoonKey user interface, allowing to interact with the authentication programattically with your own user interface.
    </ResponseField>

    <ResponseField name="showLoginEmailUI" type="boolean" default="true">
      If the login email UI is disabled (false) then the email login user interface will not be shown.
    </ResponseField>

    <ResponseField name="showLoginWaitingUI" type="number" default="true">
      If the login waiting UI is disabled (false) then the waiting screen to check credentials will not be shown.
    </ResponseField>

    <ResponseField name="networkConfig" type="Web3NetworkConfig Object">
      <Expandable title="children attributes">
        <ResponseField name="rpcUrl" type="string">
          The endpoint address used to connect to a blockchain node, enabling communication and interaction with the blockchain network through remote procedure calls (RPC).
          e.g. `https://goerli.infura.io/v3/API_KEY`
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>
