casdoor-js-sdk
Advanced tools
Comparing version 0.0.3 to 0.2.1
{ | ||
"name": "casdoor-js-sdk", | ||
"version": "0.0.3", | ||
"version": "0.2.1", | ||
"description": "Javascript client SDK for Casdoor", | ||
@@ -13,8 +13,31 @@ "main": "lib/cjs/index.js", | ||
"build:esm": "tsc -p tsconfig.esm.json", | ||
"clean": "rimraf lib" | ||
"clean": "rimraf lib", | ||
"test": "jest", | ||
"coverage": "jest --coverage" | ||
}, | ||
"jest": { | ||
"maxConcurrency": 1, | ||
"maxWorkers": 1, | ||
"testTimeout": 30000, | ||
"testEnvironment": "node", | ||
"transform": { | ||
"^.+\\.(t|j)sx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^27.0.2", | ||
"npm-run-all": "^4.1.5", | ||
"typescript": "^4.3.5", | ||
"rimraf": "^3.0.2" | ||
"typescript": "^4.5.5", | ||
"rimraf": "^3.0.2", | ||
"jest": "^27.2.1", | ||
"ts-jest": "^27.0.5" | ||
}, | ||
@@ -21,0 +44,0 @@ "files": [ |
@@ -1,1 +0,60 @@ | ||
# casdoor-js-sdk | ||
# casdoor-js-sdk | ||
[![NPM version][npm-image]][npm-url] | ||
[![NPM download][download-image]][download-url] | ||
[![codebeat badge](https://codebeat.co/badges/6f2ad052-7fc8-42e1-b40f-0ca2648530c2)](https://codebeat.co/projects/github-com-casdoor-casdoor-js-sdk-master) | ||
[![GitHub Actions](https://github.com/casdoor/casdoor-js-sdk/actions/workflows/release.yml/badge.svg)](https://github.com/casdoor/casdoor-js-sdk/actions/workflows/release.yml) | ||
[![GitHub Actions](https://github.com/casdoor/casdoor-js-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/casdoor/casdoor-js-sdk/actions/workflows/build.yml) | ||
[![Coverage Status](https://coveralls.io/repos/github/casdoor/casdoor-js-sdk/badge.svg?branch=master)](https://coveralls.io/github/casdoor/casdoor-js-sdk?branch=master) | ||
[![Release](https://img.shields.io/github/release/casdoor/casdoor-js-sdk.svg)](https://github.com/casdoor/casdoor-js-sdk/releases/latest) | ||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/casbin/casdoor) | ||
[npm-image]: https://img.shields.io/npm/v/casdoor-js-sdk.svg?style=flat-square | ||
[npm-url]: https://npmjs.com/package/casdoor-js-sdk | ||
[download-image]: https://img.shields.io/npm/dm/casdoor-js-sdk.svg?style=flat-square | ||
[download-url]: https://npmjs.com/package/casdoor-js-sdk | ||
This is Casdoor's SDK for js 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. | ||
> Noted that this sdk has been applied to casnode, if you still don’t know how to use it after reading README.md, you can refer to it | ||
## Installation | ||
~~~shell script | ||
# NPM | ||
npm i casdoor-js-sdk | ||
# Yarn | ||
yarn add casdoor-js-sdk | ||
~~~ | ||
## Init SDK | ||
Initialization requires 5 parameters, which are all string type: | ||
| Name (in order) | Must | Description | | ||
| ---------------- | ---- | --------------------------------------------------- | | ||
| serverUrl | Yes | your Casdoor server URL | | ||
| clientId | Yes | the Client ID of your Casdoor application | | ||
| appName | Yes | the name of your Casdoor application | | ||
| organizationName | Yes | the name of the Casdoor organization connected with your Casdoor application | | ||
| redirectPath | No | the path of the redirect URL for your Casdoor application, will be `/callback` if not provided | | ||
```typescript | ||
import {SDK, SdkConfig} from 'casdoor-nodejs-sdk' | ||
const sdkConfig: SdkConfig = { | ||
serverUrl: "https://door.casbin.com", | ||
clientId: "014ae4bd048734ca2dea", | ||
appName: "app-casnode", | ||
organizationName: "casbin", | ||
redirectPath: "/callback", | ||
} | ||
const sdk = new SDK(sdkConfig) | ||
// call sdk to handle | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
61
15716
6
3
0
1