claude-apimain.tsx4 matches
4const url = new URL(req.url);
56// Change the host to 'api.x.ai'
7url.host = "api.anthropic.com";
89// Create a new request object with the modified URL
21newRequest.headers.delete("cf-connecting-ip");
2223// Forward the modified request to api.x.ai
24const response = await fetch(newRequest);
2526// Return the response from api.x.ai
27return response;
28} catch (error) {
87- If the user asks to "show off" or "show your skills", you MUST use the special pre-canned "show-off" animation.
883. **Expressive Animation is Key - THE FINAL POLISH:**
89- **Detailed & Fluid Mouth Sync:** This is critical. You must generate highly detailed and rapid mouth movements to match the spoken text.
90- **Phonetic Mapping**: Break words down into their core sounds and map them to the available visemes: 'a' (for ah, cat), 'o' (for oh, food), 'e' (for see, me), 'f' (for f, v), 's' (for s, sh, ch), and 'm' (for m, b, p, and silent pauses).
91- **Use 'm' for Pauses**: Use the 'm' viseme as the default closed-mouth state. Insert very short \`M:m@<ms>\` commands between words and even syllables to simulate natural speech breaks. This is the most important rule for creating realistic animation.
117<title>AI Friend - Blorp</title>
118<script src="https://cdn.tailwindcss.com"></script>
119<link rel="preconnect" href="https://fonts.googleapis.com">
120<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
121<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Space+Mono&display=swap" rel="stylesheet">
122<style>
123:root {
343const canvas = document.getElementById('particle-canvas');
344const ctx = canvas.getContext('2d');
345const API_URL = '${sourceUrl}';
346347let mouse = { x: 0, y: 0 };
558resetIdleTimer(); setTypingIndicator(true);
559try {
560const response = await fetch(API_URL, {
561method: 'POST',
562headers: { 'Content-Type': 'application/json' },
563body: JSON.stringify({ message: userInput, history: conversationHistory }),
564});
565if (!response.ok) throw new Error(\`API Error: \${response.statusText}\`);
566const data = await response.json();
567conversationHistory.push({ role: 'user', content: userInput }, { role: 'assistant', content: JSON.stringify(data) });
create-safehash-serversql.ts2 matches
1/**
2* valtown-sql-client.ts — Secure, generic Val Town SQL API client for Deno.
3* Provides safe, parameterized CRUD and batch operations for use across your app.
4* @fileoverview All SQL is sanitized and parameterized. No raw string interpolation.
5* Requires a Val Town API token with SQLite access.
6*/
7import { sqlite } from "https://esm.town/v/std/sqlite";
create-safehash-servermain.tsx7 matches
217218// 0) Generate page-load nonce (for meta-tag/cookie)
219if (req.method === "GET" && path === "/api/page-nonce") {
220const pageNonce = generateNonce();
221await storeNonce(pageNonce);
232}
233234// 1) Issue a one-time payment nonce (for API calls)
235if (req.method === "POST" && path === "/api/create-payment-nonce") {
236if (!isValidOrigin(origin)) {
237return new Response(
273if (
274req.method === "POST"
275&& (path === "/api/create-payment-hash" || path === "/create-hash")
276) {
277if (!isValidOrigin(origin)) {
342}
343const required = [
344"apikey",
345"username",
346"password",
363}
364const {
365apikey,
366username,
367password,
406}
407const payload = [
408apikey,
409username,
410password,
209<script>
210(function() {
211const API_URL = '${sourceUrl}';
212const speakBtn = document.getElementById('speakBtn');
213const speechText = document.getElementById('speechText');
343
344try {
345const response = await fetch(API_URL, {
346method: 'POST',
347headers: { 'Content-Type': 'application/json' },
MiniAppStarterREADME.md1 match
12- Farcaster mini app manifest + webhook + embed metadata
13- Farcaster notifications (storing tokens, sending recurring notifications, ...)
14- Neynar API integration for Farcaster data
1516
MiniAppStarterneynar.ts2 matches
1const baseUrl = "/neynar-proxy?path=";
2// const baseUrl = "https://api.neynar.com/v2/farcaster/";
34export async function fetchNeynarGet(path: string) {
8"Content-Type": "application/json",
9"x-neynar-experimental": "true",
10"x-api-key": "NEYNAR_API_DOCS",
11},
12});
MiniAppStarterneynar.ts4 matches
1const NEYNAR_API_KEY = Deno.env.get('NEYNAR_API_KEY') || 'NEYNAR_API_DOCS'
2const headers = {
3'Content-Type': 'application/json',
4'x-api-key': NEYNAR_API_KEY,
5}
67export const fetchNeynarGet = async (path: string) => {
8return await fetch('https://api.neynar.com/v2/farcaster/' + path, {
9method: 'GET',
10headers: headers,
1314export const fetchNeynarPost = async (path: string, body: any) => {
15return await fetch('https://api.neynar.com/v2/farcaster/' + path, {
16method: 'POST',
17headers: headers,
MiniAppStarterindex.tsx2 matches
22}));
2324app.get("/api/counter/get", async c => c.json(await db.get("counter")));
25app.get("/api/counter/increment", async c => c.json(await db.set("counter", (await db.get("counter") || 0) + 1)));
2627app.get('/neynar-proxy', async (c) => {
MiniAppStarterimage.tsx3 matches
8586const loadEmoji = (code) => {
87// const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
88const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
89return fetch(api).then((r) => r.text())
90}
91