
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
casdoor-nodejs-sdk
Advanced tools
This is Casdoor's SDK for NodeJS will allow you to easily connect your application to the Casdoor authentication system without having to implement it from scratch.
Casdoor SDK is very simple to use. We will show you the steps below.
The following examples use Node.js Express as backend, but have different frontend frameworks. Choose the appropriate example based on your tech stack:
# NPM
npm i casdoor-nodejs-sdk
# Yarn
yarn add casdoor-nodejs-sdk
Initialization requires 5 parameters, which are all string type:
Name (in order) | Must | Description |
---|---|---|
endpoint | Yes | Casdoor Server Url, such as http://localhost:8000 |
clientId | Yes | Client ID for the Casdoor application |
clientSecret | Yes | Client secret for the Casdoor application |
certificate | Yes | x509 certificate content of Application.cert |
orgName | Yes | The name for the Casdoor organization |
appName | No | The name for the Casdoor application |
import { SDK, Config } from 'casdoor-nodejs-sdk'
import type { AxiosRequestConfig } from 'axios';
import https from 'node:https';
// Optional param for providing a self-signed CA with requests.
const axiosConfig: AxiosRequestConfig = {
httpsAgent: new https.Agent({ ca: ... })
}
const authCfg: Config = {
endpoint: '',
clientId: '',
clientSecret: '',
certificate: '',
orgName: '',
}
const sdk = new SDK(authCfg)
// or
const sdk = new SDK(authCfg, axiosConfig)
// call sdk to handle
// user
const { data: users } = await sdk.getUsers()
// auth
const token = await sdk.getAuthToken('<callback-code>')
const user = sdk.parseJwtToken(token)
FAQs
Node.js client SDK for Casdoor
The npm package casdoor-nodejs-sdk receives a total of 599 weekly downloads. As such, casdoor-nodejs-sdk popularity was classified as not popular.
We found that casdoor-nodejs-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.