Introduction to Chunks
Published 2022/08/3
Théo ChampionThis article will explain all there is to know about chunks to help you get started writing your first one.
What is a Chunk?
A "Chunk" is a project on chunk.run. It contain small unit of code (chunk) that exports a single entry-point function run() that takes JSON in and return JSON out.
This allow Chunks to execute in a predictable way, no matter the triggered it: HTTP, Webhook, Scheduled...
What language are Chunks written in?
Chunks are written in Typescript and run on Deno, a modern JT/TS runtime by the creator of Node.Js.
You can find more information and documentation in the Deno manual
With sufficient interest, more runtime options (Python, Go, Ruby...) will be added. Let us know which one you'd like to see next here
What can I use Chunks for?
People use Chunk for a wide variety of use cases including:
- Automation scripts
- Webhook handlers
- Use as a step of Make/Zapier workflow
- Growth hacking
- Connecting SaaS apps
- Custom notifications / alerting
- Simple mobile and website backends
- Prototyping and demos
Who can see my Chunks?
When you create (or remix) a Chunk, it is set to private by default, meaning only you can access it. However, you can decide to share it with the world by setting its visibility to "public" (Settings -> Visibility -> "Make Public").
Here's a few things to note about your having your Chunk public:
- it can be accessed by anyone with the link
- the .env content stays hidden to others
- the code cannot be edited by others (but the chunk can be remixed!)
- it will appear under your profile
- it may appear in the explore section of the website
Here is an example of a public Chunk: website-down-notifier
I hope this clarifies things a little and help you get started. If no, or if you have any questions, we'd be happy to anwser then by email at team@chunk.run or on Telegram.