nuxt-userbase-module
Setup
- Add
nuxt-userbase-module
dev dependency to your project
yarn add nuxt-userbase-module
or
npm install nuxt-userbase-module
-
Add
nuxt-userbase-module
to thebuildModules
section ofnuxt.config.js
. -
Add
appId
to theuserbase
section. Take it here.
buildModules: 'nuxt-userbase-module' userbase: appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
Usage
After setup, $userbase
object were injected to vue instances, nuxt context and vuex store.
Example
You can call it like:
// middleware/example.js { const session = await $userbase console // or const user = await $userbase console}
Methods
This module fully complies with the Userbase SDK.
You can use methods directly from SDK.
This module is also fully typed with typescript in accordance with the SDK.
TypeScript
If you are a Nuxt TypeScript user, you need to add declarations to your .d.ts
file for the module to work correctly.
License
Copyright © Artjom Löbsack