Public vals
27

wilt
emailToDiscordWebhook
Script
Email to Discord Forwarder Usage First, create a Discord Webhook
and add it to your Val.town environment variables . Then create an Email Val: import { getEmailHandler } from "https://esm.town/v/wilt/emailToDiscordWebhook?v=19";
// e.g. ["email@example.com", "otherEmail.address.biz"]
const senderAllowlist = JSON.parse(Deno.env.get("DISCORD_EMAIL_ALLOWLIST") || "[\"*\"]");
const webhookUrl = Deno.env.get("MY_DISCORD_WEBHOOK")!;
export default getEmailHandler({
replyToSender: false,
senderAllowlist,
webhookUrl,
}); Now, whenever you send an email to your email val, it will be forwarded to your Discord webhook
0

wilt
miniWidget
HTTP
Did you know that in recent versions of Windows 11, PWAs can add themselves as desktop widgets? This is a demo of that. Because this PWA isn't published to the Microsoft Store, if you want to try this out for yourself you'll first need to install WinAppSDK version >= 1.2 , enable Developer Mode in settings following the instructions here , and visit https://wilt-miniWidget.web.val.run to install using a recent version of Edge.
3

wilt
thisUrl
Script
Programmatically get the API URLs for the val that calls this val. For example: // @wilt.myCoolVal:
const myCoolVal = @wilt.thisUrl("web");
}
// returns:
// https://wilt-myCoolVal.web.val.run If targetVal is passed as entry , returns the URL of the very first val in the current call stack. For example: // @wilt.myFirstCoolVal:
const myFirstCoolVal = @wilt.mySecondCoolVal());
}
// @wilt.mySecondCoolVal:
const mySecondCoolVal = () => {
return @wilt.thisUrl("web", "entry");
}
// Running @wilt.myFirstCoolVal returns:
// https://wilt-myFirstCoolVal.web.val.run
0