Skip to content

Commit

Permalink
fix: Improved README
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspersorensen committed May 27, 2024
1 parent 7f09a2b commit 6cdf8eb
Showing 1 changed file with 35 additions and 30 deletions.
65 changes: 35 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
## digiseg-api-client@0.0.0-dev
# Digiseg API client for TypeScript

This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
This module provides a SDK for interacting with the Digiseg API.

Documentation for the API can be found on https://developer.digiseg.net/

## Installing and using the SDK

Install the package:

```sh
npm i digiseg-api-client
```

Import the package and start using it:

```typescript
import { AudiencesApi, Configuration } from "digiseg-api-client"

# instantiate the API (for example AudiencesAPI) with your API key
const api = new AudiencesApi(new Configuration({
apiKey: apiKey,
}))

# look up audiences
api.resolveAudiencesOfSingle("152.115.123.174", "core,category").then(resp => {
console.log("Status: " + resp.data.status)
for (const audience of resp.data.audiences) {
console.log("Audience code: " + audience.code)
}
})
```

## Environment and dependencies

This library is created for TypeScript/JavaScript and utilizes [axios](https://github.com/axios/axios). The Node module can be used in the following environments:

Environment
* Node.js
Expand All @@ -16,31 +49,3 @@ Module system
* ES6 module system

It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))

### Building

To build and compile the typescript sources to javascript use:
```
npm install
npm run build
```

### Publishing

First build the package then run `npm publish`

### Consuming

navigate to the folder of your consuming project and run one of the following commands.

_published:_

```
npm install digiseg-api-client@0.0.0-dev --save
```

_unPublished (not recommended):_

```
npm install PATH_TO_GENERATED_PACKAGE --save
```

0 comments on commit 6cdf8eb

Please sign in to comment.