File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments