Back to packages list

Vals using @valtown/sdk

Description from the NPM package:
The official TypeScript library for the Val Town API
codemore avatar
codemore
selfDestruct
Script
Forked from peterqliu/selfDestruct
0
peterqliu avatar
peterqliu
selfDestruct
Script
πŸ’₯ Deletes the val using it, or whatever url is fed it. Handy for sharing single-use scripts without cluttering people's accounts. If used in an HTTP val, this will run immediately when anyone forks it, making for a zero-click execution as long as ValTown immediately serves a preview of the forked val. Add this to your code last and then do not run it, or you will lose your work. Recommend first checking that the val owner isn't you, so that only forked copies will self-destruct. Usage selfDestruct(import.meta.url) Returns a promise of successful deletion, though the val would not be around to read it.
3
stevekrouse avatar
stevekrouse
protectiveCrimsonGalliform
Script
Forked from stevekrouse/getMyValId
0
pomdtr avatar
pomdtr
fetchValInfo
Script
Usage import { fetchValInfo } from "https://esm.town/v/pomdtr/fetchValInfo" const val = await fetchValInfo(import.meta.url) console.log(val.id) What's the difference with extractValInfo ? @pomdtr/extractValInfo get metadata synchronously by analysing the val import url, while @pomdtr/fetchValInfo perform an http call to the val.town REST api. Only use fetchValInfo if you need some metadata that are not available from extractValInfo .
1
stevekrouse avatar
stevekrouse
getMyValId
Script
Forked from stevekrouse/demoSDK
0
maxm avatar
maxm
valTownSdkBlobExample
Script
// the value string should be a readable
0
stevekrouse avatar
stevekrouse
wonderfulIndigoScallop
Script
Forked from stevekrouse/demoSDK
0
yawnxyz avatar
yawnxyz
valVersions
Script
* Retrieves a user by their username. * @param {string} username - The username of the user to retrieve. * @returns {Promise<Object>} The user object.
1
pomdtr avatar
pomdtr
webdavServer
Script
Webdav Manage your vals from a webdav client (ex: https://cyberduck.io/) ⚠️ some webdav operations are not supported, so support can vary between clients. Installation Click "Create Val" on the code block, and change it's type to http. import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth"; import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken"; import { serveVals } from "https://esm.town/v/pomdtr/webdavServer"; export default basicAuth(serveVals, { verifyUser: (user) => { return verifyToken(user); }, }); Use a val town token as the username, and keep the password blank to authenticate.
5
yawnxyz avatar
yawnxyz
demoSDK
Script
Forked from stevekrouse/demoSDK
0
iamseeley avatar
iamseeley
demoSDK
Script
Forked from stevekrouse/demoSDK
0
ejfox avatar
ejfox
allvals
HTTP
An interactive, runnable TypeScript val by ejfox
0
janpaul123 avatar
janpaul123
valle_tmp_562580635116363837652861654341074
HTTP
@jsxImportSource https://esm.sh/react
0
janpaul123 avatar
janpaul123
valle_tmp_54185991019187464068579562776686
HTTP
@jsxImportSource https://esm.sh/react
0
janpaul123 avatar
janpaul123
valle_tmp_54846529024345792066850117206065
HTTP
@jsxImportSource https://esm.sh/react
0
janpaul123 avatar
janpaul123
valle_tmp_610457425865436710444833460520275
HTTP
@jsxImportSource https://esm.sh/react
0