FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
steveruizok
steveruizoktldraw_computer_example
Public
Like
6
tldraw_computer_example
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
17
History
Environment variables
Settings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://steveruizok--5fafeeb8278011f0b46e569c3dd06744.web.val.run
README.md

tldraw computer custom endpoint example

This val is an example custom endpoint for tldraw computer's data component.

Usage

To use this val with tldraw.computer, follow these steps:

  1. Fork this Val.
  2. Click the Copy endpoint button on your new Val.
  3. Open a project on tldraw.computer
  4. Create a Data component in your tldraw computer project
  5. In the Source dropdown, select Custom and the POST method
  6. Paste the endpoint into Data component's the HTTP Endpoint input.
  7. Run the component.

To see the output, connect the Data component to a Text component.

How it works

In tldraw computer, you can configure a Data component to use a custom HTTP endpoint as its data source. You can also configure the request method, either GET or POST.

If a Data component's request method is POST, then when the component next updates, it will send a POST request to the endpoint. The request's body will contain an array of the Data objects that the component had received as inputs.

If the request method if GET, then the component will only make the request—its body will be empty.

In both cases, the component will expect back a response that includes an array of Data objects these objects will be passed along as the data component's outputs.

The endpoint (your forked version of this Val) can do whatever it likes between the request and response, but the response must include data in the correct format. If the format is wrong, the computer app will create a text data object instead that includes the response as plain text.

Support

If you're running into any difficulties, check out the #tldraw-computer channel on the tldraw discord.

HTTP
  • main.tsx
    steveruizok--5f…44.web.val.run
Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.