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

Website changes docs playground #10413

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

FelixMalfait
Copy link
Member

From #10376 (extracting website related changes)

@FelixMalfait
Copy link
Member Author

@oliverqx could you please check if I didn't forget anything when creating the patch? Thanks!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR removes the API playground components from the documentation website and introduces new API & webhooks documentation, indicating a shift to hosting the playground within the Twenty application's settings.

  • Removed all playground-related components (rest-api-wrapper.tsx, graphql-playground.tsx, token-form.tsx) and their associated styles from /packages/twenty-website/src/app/_components/playground/
  • Added comprehensive webhooks documentation in /packages/twenty-website/src/content/developers/api-and-webhooks/webhooks.mdx covering setup, events, and security practices
  • Added new API documentation in /packages/twenty-website/src/content/developers/api-and-webhooks/api.mdx explaining the move of the playground to app settings
  • Restructured documentation by moving API content from 'Extending' to 'Getting Started' section in DocsIndex.ts
  • Removed separate REST and GraphQL API documentation files, consolidating content into the new API documentation

16 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

## Security and Best Practices
When using webhooks, you should secure your endpoint since it will be accepting incoming requests:

* **Validate Source:** Since the requests come from Twenty’s servers, you may want to verify the request truly originated from Twenty. Currently, Twenty’s webhook requests do not include a built-in signature or secret (no shared secret token was set during creation in the current version). A common practice is to use a secret token in the URL itself or as a header that only you and the Twenty system know, to validate the call. For example, when setting the webhook URL in settings, you might include a query param like `?token=YOUR_SECRET`. Your endpoint can then check that token on each request.
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Recommending to include tokens in URLs is not a secure practice as URLs can be logged. Consider recommending custom HTTP headers or signed payloads instead.

Suggested change
* **Validate Source:** Since the requests come from Twentys servers, you may want to verify the request truly originated from Twenty. Currently, Twentys webhook requests do not include a built-in signature or secret (no shared secret token was set during creation in the current version). A common practice is to use a secret token in the URL itself or as a header that only you and the Twenty system know, to validate the call. For example, when setting the webhook URL in settings, you might include a query param like `?token=YOUR_SECRET`. Your endpoint can then check that token on each request.
* **Validate Source:** Since the requests come from Twenty's servers, you may want to verify the request truly originated from Twenty. Currently, Twenty's webhook requests do not include a built-in signature or secret (no shared secret token was set during creation in the current version). A common practice is to use a custom HTTP header (e.g. `X-Twenty-Token`) that only you and the Twenty system know, to validate the call. Your endpoint can then check that header value on each request.

"firstName": "Alice",
"lastName": "Doe",
"email": "[email protected]",
"createdAt": "2025-02-10T15:30:45Z",
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Example uses a future date (2025). Should use a past or present date for the example.

## Overview
The Twenty API allows developers to interact programmatically with the Twenty CRM platform. Using the API, you can integrate Twenty with other systems, automate data synchronization, and build custom solutions around your customer data. The API provides endpoints to **create, read, update, and delete** core CRM objects (such as people and companies) as well as access metadata configuration.

**API Playground:** The interactive API Playground has been removed from this documentation site. You can now access the API Playground within your Twenty application’s settings. To try out API calls in real-time, log in to your Twenty app and navigate to **Settings > API & Webhooks** (under **Developers**). This will open the in-app API Playground and settings for API keys. _(If you don’t see the API & Webhooks section in Settings, enable “Advanced mode” in your app settings to reveal developer options.)_ **➡️ [[Go to API Settings](https://app.twenty.com/settings)](https://app.twenty.com/settings)**
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: Double link wrapping: [[Go to API Settings](https://app.twenty.com/settings)](https://app.twenty.com/settings) creates invalid markdown. Remove one set of brackets.

Copy link
Contributor

Choose a reason for hiding this comment

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

style: Removing this file may break existing documentation links and references. Ensure all internal links are updated accordingly.

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.

2 participants