Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from OneSignal/api
Browse files Browse the repository at this point in the history
Update README.md for 5.0.0-alpha-01
nan-li authored May 3, 2024
2 parents c5c1f5a + 4548798 commit fe3bf2d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -61,8 +61,8 @@ You can configure auth parameters passing them like this:

```js
const configuration = OneSignal.createConfiguration({
userKey: '<YOUR_USER_KEY_TOKEN>',
appKey: '<YOUR_APP_KEY_TOKEN>',
userAuthKey: '<YOUR_USER_AUTH_KEY>',
restApiKey: '<YOUR_REST_API_KEY>',
});

const client = new OneSignal.DefaultApi(configuration);
@@ -76,8 +76,8 @@ parameter. You can then use this to modify your configuration object and create
const response = await client.createApp(newapp);

const configuration = OneSignal.createConfiguration({
userKey: '<YOUR_USER_KEY_TOKEN>',
appKey: response.basic_auth_key,
userAuthKey: '<YOUR_USER_KEY_TOKEN>',
restApiKey: response.basic_auth_key,
});

const client = new OneSignal.DefaultApi(configuration);
@@ -86,14 +86,14 @@ const client = new OneSignal.DefaultApi(configuration);
---
## API Reference

> See the full list of [API Endpoints](DefaultApi.MD).
> See the full list of [API Endpoints](DefaultApi.md).
To make stateful changes requests should take on the following pattern:
1. create or get an object
2. make changes to that object
3. pass the object to the request function to make the changes

Examples of important OneSignal objects include `App`, `Notification`, `Player`, and `Segment`.
Examples of important OneSignal objects include `App`, `Notification`, `User`, and `Segment`.

For example, see the section below on creating an app. First an app object is created via the instantiation of the `App`
class. Then, the app instance is modified directly. Finally, we use the `client` to create the app via a remote request.

0 comments on commit fe3bf2d

Please sign in to comment.