Skip to content

Commit

Permalink
Update Resolution() init to reference an API key
Browse files Browse the repository at this point in the history
  • Loading branch information
qrtp committed Apr 12, 2024
1 parent a7bca3d commit c710d58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import 'whatwg-fetch'
(global as any).XMLHttpRequest as any
).XMLHttpRequestUpload

const resolution = new Resolution()
// obtain a key by following this document https://docs.unstoppabledomains.com/domain-distribution-and-management/quickstart/retrieve-an-api-key/#api-key
const REPLACE_WITH_YOUR_OWN_KEY = 'TODO'
const resolution = new Resolution({apiKey: REPLACE_WITH_YOUR_OWN_KEY})

const client = new Client({
clientID: '1f7296d5-e6de-4a70-bcfd-c6a6d90e3974',
Expand Down
9 changes: 7 additions & 2 deletions packages/js/src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ export default class Client {
constructor(options: ClientOptions) {
this.fallbackIssuer =
options.fallbackIssuer ?? 'https://auth.unstoppabledomains.com'
this.resolution = options.resolution ?? new Resolution()
this.resolution =
options.resolution ??
// obtain a key by following the following document, and set the environment variable RESOLUTION_API_KEY.
// https://docs.unstoppabledomains.com/domain-distribution-and-management/quickstart/retrieve-an-api-key/#api-key
new Resolution({apiKey: process.env.RESOLUTION_API_KEY})

this.storeOptions = {
store: options.store,
Expand Down Expand Up @@ -492,7 +496,8 @@ export default class Client {
userinfo.nickname = 'upgrade-for-premium'
userinfo.preferred_username = 'upgrade-for-premium'
userinfo.profile = 'upgrade-for-premium'
userinfo.picture = 'https://storage.googleapis.com/unstoppable-client-assets/images/partners/avatar-placeholder.png'
userinfo.picture =
'https://storage.googleapis.com/unstoppable-client-assets/images/partners/avatar-placeholder.png'
userinfo.website = 'upgrade-for-premium'
userinfo.gender = 'upgrade-for-premium'
userinfo.birthdate = 'upgrade-for-premium'
Expand Down

0 comments on commit c710d58

Please # to comment.