Skip to content
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

Merged
merged 2 commits into from Mar 25, 2024
Merged

Improve scripts reference docs #1905

merged 2 commits into from Mar 25, 2024

Conversation

bastienbeurier
Copy link
Member

Describe your changes

Issue ticket number and link

Checklist before requesting a review (skip if just adding/editing APIs & templates)

  • I added tests, otherwise the reason is:
  • I added observability, otherwise the reason is:
  • I added analytics, otherwise the reason is:

```js
const res = await nango.get({
endpoint: '/endpoint',
baseUrlOverride: 'https://base-url.com'
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

</ResponseField>
</Expandable>
</ResponseField>
</Expandable>
Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done!

</ResponseField>
<ResponseField name="data" type="unknown">
The body of the request.
</ResponseField>
Copy link
Collaborator

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

Copy link
Member Author

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same a get. deletedoesn't take a body

<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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor

@bodinsamuel bodinsamuel left a 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 Show resolved Hide resolved
docs-v2/reference/scripts.mdx Outdated Show resolved Hide resolved

### Edit connection metadata

Edit custom metadata for the connection. Only overrides specified properties, not the entire metadata.
Copy link
Member

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
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited!

@bastienbeurier bastienbeurier merged commit e065491 into master Mar 25, 2024
19 checks passed
@bastienbeurier bastienbeurier deleted the script-ref branch March 25, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants