auth-js (e-city Auth Client)
raw JSON → 0.0.16 verified Sat Apr 25 auth: no javascript maintenance
A Vue.js plugin for authentication on the e-city platform, providing methods for sign-in, sign-out, password update, account management, image upload, address management, module permissions, and fetching current user info. Currently at version 0.0.16, with no stable release cadence. It is tightly coupled to a specific backend (http://isse.paliari.com.br/app/rest) and requires a Promise polyfill for older browsers. Not actively maintained; limited documentation and no TypeScript support.
Common errors
error Cannot find module 'auth-js' ↓
cause Package not installed or not in node_modules.
fix
Run
npm install auth-js or yarn add auth-js in your project root. error TypeError: AuthJs is not a constructor ↓
cause Using import statement instead of require, or incorrect capitalization.
fix
Use
const AuthJs = require('auth-js') and ensure the variable name matches. error Uncaught (in promise) TypeError: Cannot read property 'signIn' of undefined ↓
cause Auth not properly installed via Vue.use().
fix
Install the plugin correctly:
Vue.use(Auth, { baseURL }) after defining Auth with install function. Warnings
gotcha No TypeScript definitions provided; cannot use typed imports. ↓
fix Manually create a .d.ts file or use `// @ts-ignore` for type safety.
breaking Methods return promises but no error handling for network failures; promises may reject without clear messages. ↓
fix Always attach .catch() to handle errors gracefully.
gotcha The package relies on a hardcoded external API (http://isse.paliari.com.br/app/rest) — not configurable per instance beyond baseURL. ↓
fix Ensure the API is accessible and matches expected endpoints.
Install
npm install auth-js yarn add auth-js pnpm add auth-js Imports
- AuthJs wrong
import AuthJs from 'auth-js'correctconst AuthJs = require('auth-js') - Vue plugin installation wrong
Vue.prototype.$auth = AuthJs({ baseURL })correctconst Auth = { install (Vue, options) { Vue.prototype.$auth = AuthJs(options) } } Vue.use(Auth, { baseURL })
Quickstart
const AuthJs = require('auth-js')
const baseURL = 'http://isse.paliari.com.br/app/rest'
const auth = AuthJs({
appModule: 'nfse',
baseURL,
statusBar: 'darken'
})
auth.signIn().then(response => {
console.log('signed in', response.token)
}).catch(err => console.error(err))