Skip to content

Commit 9724bce

Browse files
authored
Create unsplash.md (#629)
1 parent bfa2ddb commit 9724bce

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/config-examples/unsplash.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Unsplash
2+
3+
If you don't already have a unsplash app, create it [here](https://unsplash.com/oauth/applications).
4+
5+
Once you have an app, go to your app page. Here you'll need to add two things:
6+
7+
1. Redirect URL
8+
Under "Redirect URLs", add one for your app, e.g. `com.myapp://oauth` and save
9+
10+
2. Scopes
11+
Under "Scopes", add the scopes you want to request from the user, e.g, "public"
12+
13+
```js
14+
const config = {
15+
usePKCE: false, // Important !!
16+
clientId: '<client_id>', // found under App Credentials
17+
clientSecret: '<client_secret>', // found under App Credentials
18+
scopes: ['public'], // choose any of the scopes set up in step 1
19+
redirectUrl: 'com.myapp://oauth', // set up in step 2
20+
serviceConfiguration: {
21+
authorizationEndpoint: 'https://unsplash.com/oauth/authorize',
22+
tokenEndpoint: 'https://unsplash.com/oauth/token',
23+
},
24+
};
25+
26+
const authState = await authorize(config);
27+
```

0 commit comments

Comments
 (0)