svelte-instagram-login

1.0.1 • Public • Published

svelte-instagram-login

An Instagram Sign-in / Log-in Svelte

Api guide

Install

  npm install -save svelte-instagram-login

How to use

    <script>
      import InstagramLogin from 'svelte-instagram-login';

      const handleSuccess = ({ detail: { data }}) => {
        console.log(data); // code or token
      }

      const handleFailure = ({ detail: { error, errorReason, errorDescription }}) => {
        // error code
      }
    </script>

    // custom
    <InstagramLogin 
      clientId="your_client_id" 
      redirectUrl="your_redirect_url" 
      on:success={handleSuccess}
      on:failure={handleFailure}
      customRender>
      <button>Custom instagram button</button>
    </InstagramLogin>

    // no custom
    <InstagramLogin 
      clientId="your_client_id" 
      redirectUrl="your_redirect_url" 
      on:success={handleSuccess}
      on:failure={handleFailure} />

Events & value

  • clientId (required) [string]
  • scope (optional) [string] - default: basic
  • implicitAuth (optional) [boolean] - default: false
  • customRender (optional) [boolean] - default: false
  • redirectUrl (optional) [boolean] - default: window.location.href
  • style (optional) [string] - default: style="border: 1px solid #ffffff"
  • bind:ref (optional) [htmlelement] - default: null
  • on:success [func]
  • on:failure [func]

License

MIT

Package Sidebar

Install

npm i svelte-instagram-login

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

52 kB

Total Files

5

Last publish

Collaborators

  • dongheebae