Migration option for bots and other time-triggered apps: val.town

hi! i wanted to share that i moved my bluesky bot, countingsheep over to val.town and it was a nice editing experience, and i recommend it for your bots or other projects that perhaps just need an api service.

jennschiffer/counting-sheep-on-bluesky | Val Town ← here’s my code for the bot, formerly ~hello-bluesky-sheep. they have remixing like glitch, also the people that work there are nice (they’re based in brooklyn).

their free account lets you run a cron job at a minimum of 15 minutes, and their paid account allows 1 minute. i am able to persist the sheep count via their blob storage, which is also free and came in very handy. just know that if you do remix it, you’ll need to re-enter the environment variable keys in the env section, as they appear to not be carried over. i haven’t used their email trigger feature (free accounts can only email themselves) but i definitely will be playing around with that in the future.

i need to find a solution for my websocket servers still so i’m holding off on paying until i know what other service/hosting i’ll need to pay for (your girl is on a budget), but ideally i’ll be able to afford paying for premium so i can have the sheep counting every minute vs 15 minutes.

9 Likes

I second this - have moved 14 bluesky bots to val town, and a couple of web apps

the UI for editing is really nice, and the ability to set cron jobs is perfect for bots

a few gotchas though:

  • val town uses deno rather than node, so you need to convert your npm module imports from the node way to the deno way, eg
import { AtpAgent, RichText } from "npm:@atproto/api";
import { createClient } from "npm:@libsql/client";
  • http servers work differently, and you don’t need to set up fastify or express yourself just to get a website online

  • it isn’t set up for static file hosting, for a web app that means images, css, js, etc. I’ve got around this by using val town to provide an API, and creating static sites in Netlify that call the APIs

  • environment variable handling isn’t great as Jenn mentioned

to help with all this, I used github copilot to convert a lot of the code (you could also use chatgpt or val town’s own “townie” LLM)

best of all, for the same price as glitch you get unlimited always-on projects