npm.io
2.0.5 • Published 2 months ago

privy-sdk

Licence
MIT
Version
2.0.5
Deps
4
Size
191 kB
Vulns
0
Weekly
0

PRIVY SDK

Privy ID Software Development Kit

npm version

Login with PrivyID Button

Step 1: Include Privy SDK

<script src="http://unpkg.com/privy-sdk"></script>
Step 2: Init SDK and place your Merchant Key
Privy.init({
  merchantKey: '< Your Merhant Key>',
})
Step 3: Place this code in wherever you want login button appear in your page
<div class="privy-login-btn" data-width="inline" data-size="medium"></div>

Options

data-size
  • small
  • medium
  • large
data-width
  • inline
  • full
data-color
  • red
  • white
data-style
  • solid
  • outline
data-lang
  • en
  • id

Custom Button

You can create custome login button

<button onclick="loginWithPrivy">
  Login with Privy
</button>
...
...
<script>
  Privy.init({
    merchantKey: '< Your Merhant Key>',
  })

  function loginWithPrivy () {
    Privy.login()
  }
</script>

Development Mode

Add dev: true to change endpoint to development

Privy.init({
  merchantKey: '< Your Merhant Key>',
  dev: true,
})

License

This project is licensed under the MIT License - see the LICENSE file for details