New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve scripts reference docs #1905
Conversation
docs-v2/reference/scripts.mdx
Outdated
```js | ||
const res = await nango.get({ | ||
endpoint: '/endpoint', | ||
baseUrlOverride: 'https://base-url.com' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we mention baseUrlOverride (here and in the example below)? It is a optional param that is defined below. I would keep the example as simple as possible imho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
docs-v2/reference/scripts.mdx
Outdated
</ResponseField> | ||
</Expandable> | ||
</ResponseField> | ||
</Expandable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to have a section describing the fields common to all the methods instead of repeating them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done!
docs-v2/reference/scripts.mdx
Outdated
</ResponseField> | ||
<ResponseField name="data" type="unknown"> | ||
The body of the request. | ||
</ResponseField> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think get
has a data field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, it's not standard but technically possible.
</ResponseField> | ||
<ResponseField name="data" type="unkown"> | ||
The body of the request. | ||
</ResponseField> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same a get
. delete
doesn't take a body
docs-v2/reference/scripts.mdx
Outdated
<Tip> | ||
The script helper object shares some methods, but not all, with the [Node backend SDK](/reference/sdks/node), which is why this reference will link to the Node SDK reference a lot. | ||
Note that all HTTP requests benefit from automatic credential injection. Because scripts are executed in the context of a specific integration & connection, Nango can automatically retrieve & refresh the relevant API credentials. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that all HTTP requests benefit from automatic credential injection. Because scripts are executed in the context of a specific integration & connection, Nango can automatically retrieve & refresh the relevant API credentials. | |
Note that all HTTP requests benefit from automatic credential injection. Because scripts are executed in the context of a specific integration & connection, Nango can automatically retrieve & refresh the relevant API credentials. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments 👌🏻
docs-v2/reference/scripts.mdx
Outdated
|
||
### Edit connection metadata | ||
|
||
Edit custom metadata for the connection. Only overrides specified properties, not the entire metadata. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it clear that it overrides and also adds properties potentially?
await nango.updateMetadata({
'CUSTOM_KEY1': 'CUSTOM_VALUE1',
'new-prop': 'new-value
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edited!
Describe your changes
Issue ticket number and link
Checklist before requesting a review (skip if just adding/editing APIs & templates)