Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@ Node.js SDK for Permanent.org
Built on [bitjson/typescript-starter](https://github.com/bitjson/typescript-starter)

![Unit tests](https://github.com/PermanentOrg/node-sdk/workflows/Unit%20tests/badge.svg?branch=main)

## Usage

The client needs to be configured with access keys, available on request from engineers@permanent.org.

```js
// ES import
import { Permanent } from '@permanentorg/node-sdk';

// CommonJS
const Permanent = require('@permanentorg/node-sdk').Permanent;

// Configure with credentials
const permanent = new Permanent({
sessionToken,
mfaToken,
archiveId,
});

// Ready to use!
const isSessionValid = await permanent.auth.isSessionValid();
```

## Developing

To start working, run the `watch:build` task using [`npm`](https://docs.npmjs.com/getting-started/what-is-npm) or [`yarn`](https://yarnpkg.com/).

```sh
Expand All @@ -19,6 +43,7 @@ npm run watch:test
```

## Testing

To run all tests (unit tests, formatting, linting), run the `test` task:

```sh
Expand Down
205 changes: 200 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"node": ">=10"
},
"dependencies": {
"@bitauth/libauth": "^1.17.1"
"axios": "^0.19.0"
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
Expand All @@ -50,6 +50,7 @@
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",
"axios-mock-adapter": "^1.18.2",
"codecov": "^3.5.0",
"cspell": "^4.1.0",
"cz-conventional-changelog": "^3.3.0",
Expand All @@ -64,6 +65,7 @@
"prettier": "^2.1.1",
"standard-version": "^9.0.0",
"ts-node": "^9.0.0",
"ts-sinon": "^2.0.1",
"typedoc": "^0.19.0",
"typescript": "^4.0.2"
},
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './lib/async';
export * from './lib/number';
export { Permanent } from './lib/client';
Loading