Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Sep 11, 2024
1 parent 9a459c0 commit c30f25e
Showing 1 changed file with 1 addition and 144 deletions.
145 changes: 1 addition & 144 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,147 +29,4 @@
---
The Paradym TypeScript SDK offers seamless integration with the [Paradym API](https://paradym.id/reference), enabling developers to interact with Paradym's features from TypeScript applications. This SDK simplifies the process of making API requests, allowing you to focus on building your application.


## Getting Started

First, you need to add the dependency to your project:

```sh
npm install @paradym/sdk
# or
yarn add @paradym/sdk
```

## Usage

#### Initialize client
Initialize the client with your API key, which you can find in the [Paradym Dashboard](https://paradym.id/app/settings/api-keys). Set up the client as follows:

```ts
import Paradym from '@paradym/sdk'

const paradym = new Paradym({
apiKey: "API_KEY"
})
```

#### Create a SD-JWT-VC Credential Template
```typescript
import Paradym from '@paradym/sdk'

const paradym = new Paradym({
apiKey: "API_KEY"
})

paradym.templates.credentials.createSdJwtVcTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
name: "My SD-JWT VC template",
description: "This is a description",
issuer: "did:web",
background: {
color: "#FFFFFF",
url: "https://example.com/image.png"
},
text: {
color: "#000000"
},
validFrom: "2024-04-11",
validUntil: {
start: "validFrom",
future: { years: 5 }
},
type: "UniversityCard",
revocable: false,
attributes: {
myAttribute: {
type: "string",
name: "My attribute",
description: "This is a attribute",
required: true,
alwaysDisclosed: false
}
}
}
})

```

#### Create an Issuance Offer:
```typescript
import Paradym from '@paradym/sdk'
const paradym = new Paradym({
apiKey: "API_KEY"
})

paradym.openId4Vc.issuance.createIssuanceOffer({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
credentials: [{
credentialTemplateId: 'clwt6e610000101s69ubga6lk',
attributes: {
"name": "John Doe"
},
}]
}
})
```

#### Create a SD-JWT presentation template:
```ts
import Paradym from '@paradym/sdk'
const paradym = new Paradym({
apiKey: "API_KEY"
})

const sdJwtPresentationTemplate = await paradym.templates.presentations.createPresentationTemplate({
projectId: 'clwt6e620000101s69ubga6lk',
requestBody: {
credentials: [
{
description: 'This is a description',
name: 'My SD-JWT VC credential',
format: 'sd-jwt-vc',
type: 'https://metadata.paradym.id/types/28dc88-UniversityCard',
attributes: {
myAttribute1: {
type: 'string',
value: 'myValue',
},
myAttribute2: {
type: 'number',
minimum: 1,
maximum: 10,
},
myAttribute3: {
type: 'boolean',
value: true,
},
},
},
],
description: 'This is a description',
name: 'My SD-JWT VC presentation',
},
})
```

#### Create a SD-JWT Verification Request:
```ts
import Paradym from '@paradym/sdk'
const paradym = new Paradym({
apiKey: "API_KEY"
})

paradym.openId4Vc.verification.createVerificationRequest({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
presentationTemplateId: 'clwt6e610000101s69ubga6lk',
}
})
```

## License

This project is licensed under the [Apache 2.0
License](https://opensource.org/licenses/Apache-2.0).
Check out the [TypeScript SDK docs](https://docs.paradym.id/api-and-dashboard/typescript-sdk) for installation instructions and usage information.

0 comments on commit c30f25e

Please sign in to comment.