Skip to content

Commit

Permalink
fix: link to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcuva committed Dec 19, 2023
1 parent b8a680d commit 44951dc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ const readme = (

const getUser: GetUserFunction = async ({ byAPIKey, byEmail, manualAPIKey }) => {
if (!byAPIKey && !options.disableMetrics) {
console.error('Missing required definition for byAPIKey');
console.error('This should be much more useful than it is.');
console.error(
'Missing required definition for byAPIKey. Learn more here: https://docs.readme.com/main/docs/unified-snippet-docs#/getuserbyapikey',
);
return next();
}
if (!byEmail && !options.disableWebhook) {
console.error('Missing required definition for byEmail');
console.error('This should be much more useful than it is.');
console.error(
'Missing required definition for byEmail. Learn more here: https://docs.readme.com/main/docs/unified-snippet-docs#/getuserbyapikey',
);
return next();
}

Expand All @@ -97,7 +99,7 @@ const readme = (
requestAPIKey = findAPIKey(req);
} catch (e) {
console.error(
'Could not automatically find API key in the request. You should pass the API key via `manualAPIKey` in the getUser function. Learn more here: [link to docs]',
'Could not automatically find API key in the request. You should pass the API key via `manualAPIKey` in the getUser function. Learn more here: https://docs.readme.com/main/docs/unified-snippet-docs#getuserbyapikey',
);
}
return byAPIKey(requestAPIKey);
Expand Down Expand Up @@ -165,7 +167,7 @@ const readme = (
console.error(
usingManualAPIKey
? 'The API key you passed in via `manualAPIKey` could not be found in the user object you provided.'
: 'Could not automatically find API key in the request. You should pass the API key via `manualAPIKey` in the getUser function. Learn more here: [link to docs]',
: 'Could not automatically find API key in the request. You should pass the API key via `manualAPIKey` in the getUser function. Learn more here: https://docs.readme.com/main/docs/unified-snippet-docs#/getuserbyapikey',
);
return next();
}
Expand Down

0 comments on commit 44951dc

Please sign in to comment.