https://github.com/kwintenvdb/unity-publisher-api
https://github.com/kwintenvdb/unity-publisher-api
hacktoberfest unity
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kwintenvdb/unity-publisher-api
- Owner: Kwintenvdb
- Created: 2020-10-03T19:42:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-22T20:49:11.000Z (over 4 years ago)
- Last Synced: 2025-01-23T01:13:52.357Z (5 months ago)
- Topics: hacktoberfest, unity
- Language: TypeScript
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unity Publisher API
A small Node.js library to fetch data from the Unity Publisher API. This data is normally only available through the [Unity Publisher Administration](https://publisher.assetstore.unity3d.com/) page.
Note that this will only run on Node.js, not in the browser.
## Usage
The following example authenticates the user, fetches all month data, and then fetches the sales of the first available month.
```ts
const api = new UnityPublisherApi();
await api.authenticate(my_email, my_password);
const months = await api.getMonthsData();
const sales = await api.getSalesData(months[0].value); // You can fetch sales data per month
```The api instance stores the authentication cookies after the first authentication, and they are used for each subsequent request. The cookies will expire after some time, after which you will need to call `authenticate` again.