1.0.0 • Published 4 years ago
@badaso/nuxt v1.0.0
@badaso/nuxt
Nuxt module for integration with badaso out of the box.
Features
- RESTful methods
- Handle errors with hooks
Installation
Using npm:
npm install @badaso/nuxtUsing yarn:
yarn add @badaso/nuxtConfigure
Add @badaso/nuxt to the modules section of nuxt.config.js:
export default {
modules: ['@badaso/nuxt'],
badaso: {
// Options
}
}Options
endpointDefault:process.env.BADASO_URL || 'http://localhost:8000'URL of the Badaso server. Environtment variable BADASO_URL can be used to overrideendpoint.entitiesDefault:{}You can specify the entities that present in your API. For example:
Then you can useexport default { badaso: { entities: { post: true, crud: ['articles', 'products'] } } }this.$badaso.$post.browse()in your application. For now, entities only accept:post:Booleancontent:Booleancrud:Array
keyKey used for the cookie name as well as localStorage/sessionStorage key.prefixDefault:badaso-apiURL prefix to access Badaso API server.
Usage
Authentication
To handle authentication in your Nuxt app with Badaso, you can:
Login
await this.$badaso.login({ email: '', password: '' })Register
await this.$badaso.register({ email: '', name: '', password: '', passwordConfirmation: '' })Verify
await this.$badaso.verify({ email: '', token: '' })Resend Email Verification
await this.$badaso.sendEmailConfirmation({ email: '' })Logout
await this.$badaso.logout()Forgot Password
await this.$badaso.forgotPassword({ email: '' })Verify Token for Forgot Password
await this.$badaso.verifyForgotPasswordToken({ email: '', token: '' })Reset Password
await this.$badaso.resetPassword({ email: '', password: '', token: '' })User
Once logged in, you can access your user everywhere:
this.$badaso.userPost Module
Content Module
For content module, please refer to this page
CRUD Generated
For CRUD generated, please refer to this page
Development
- Clone this repo
- Install dependencies using
npm installoryarn install - Start development server using
npm run devoryarn dev
1.0.0
4 years ago
1.0.0-rc.2
4 years ago
1.0.0-rc.1
4 years ago
1.0.0-rc
4 years ago
1.0.0-alpha.3
4 years ago
1.0.0-alpha.2
4 years ago
1.0.0-alpha.1
4 years ago