Learn how to integrate Kobble in any Javascript Application.
Install @kobbleio/javascript
Initialize the SDK
src/kobble/index.ts
where you will initialize the SDK and export the Kobble instance.Create a callback handler
Use the loginWithRedirect method
loginWithRedirect
method to redirect the user to the Kobble login page whenever we want to authenticate the user.For example with a simple button in vue.js:Promise<void>
Promise<void>
Promise<User | null>
Where User is matching the following type:
Promise<string | null>
Promise<string | null>
Promise<boolean>
Promise<Permission[]>
Where Permission is matching the following type:
Promise<boolean>
Promise<Quota[]>
Where Quota is matching the following type:
hasRemainingQuota
method.
Promise<boolean>
Promise<string | null>
'_blank' | '_self'
- default is '_self'
Promise<void>
'_blank' | '_self'
- default is '_self'
Promise<void>
string
string
string
KobbleClient
from @kobbleio/javascript
, you will need to import the KobbleWebExtensionClient
from @kobbleio/javascript/web-extension
.
Authorized redirect URIs
section and click on Edit
.https://ID.chromiumapp.org/callback
where ID
is the ID of your Chrome extension.chrome://extensions/
. Here is more information about how to find your ID. Note that the ID may change if you remove and reload your extension.KobbleWebExtensionClient
does not need to handle the redirect callback.
Which means that the loginWithRedirect
method will directly return the user tokens and you won’t have to create a callback page nor using the handleRedirectCallback
method.