• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
nbbaier

nbbaier

saveToTana

Public
Like
saveToTana
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Save To Tana

This val provides a function saveToTana allows the creation of nodes in Tana via their Input API. The parameters are as follows:

  • Token: to access the Tana Input API, you must pass an API token to the function. Obtain an API token from the Tana app and save it as a secret in Val Town.
  • Node: the node that is created within Tana is passed as the second argument and must conform to the shape of an Input API node (see the documentation on github for details.
  • Target node: optionally, you can specify a specific target node by passing a node ID to the function as it's third argument.

Example Usage

One way to use this val is with a web endpoint that you can send data to to have parsed and submitted to Tana as a specific type of node. For example, this val

Create val
import { saveToTana } from "https://esm.town/v/nbbaier/saveToTana"; import { APIPlainNode } from "https://esm.town/v/nbbaier/tanaTypes"; import { Hono } from "npm:hono"; const token = Deno.env.get("tanaInputAPI"); export const honoTanaEndpoint = async (req: Request) => { const app = new Hono(); app.get("/", async c => { let { text, url } = c.req.query(); const payload: APIPlainNode = { name: text, children: [ { type: "field", attributeId: "cwi23sOzRSh8", children: [ { dataType: "url", name: url, }, ], }, ], supertags: [], }; const newNode = await saveToTana(token, payload); return c.json({ newNode }); }); return app.fetch(req); };

Combined with a Chrome extension like Rich URL, the above val allows one to send selected text on a page along with that pages URL to Tana via the val's public GET endpoint.

Screenshot 2023-10-27 at 4.13.22 PM.png

Migrated from folder: projects/tana/saveToTana

Code
README.mdmain.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.