Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Widget embed loader — use a stable slug so token rotation does not break live embeds

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
nextjs, typescript
Ambito
api, backend

Direzione di ricerca

Start by reading app/api/widget/chat/route.ts for the established public-endpoint abuse controls. Then trace the existing embed snippet and widget-token lookup to identify where slug resolution, owner/admin editing, and backward compatibility fit. Done means embeds can use a stable slug that resolves the current token, existing token-based snippets still work, and the resolve endpoint has the specified rate limits and body cap.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

The widget embed snippet contains the raw widget token. That means rotating the token requires every customer to edit and redeploy the page it is embedded on — and for docs sites, to make a commit.

The problem

Rotation currently breaks every live embed until each one is manually updated. That makes rotation something people avoid, which is the opposite of what you want.

Proposed fix

Ship a loader script that takes a stable public slug instead of the token:

<script src="https://<host>/embed.js" data-site="acme-support"></script>

The loader resolves the slug to the current token at load time. Rotating the token then takes effect everywhere immediately, with no customer-side change.

Considerations

  • The slug is a public identifier, exactly like the token is today — this changes the rotation story, not the trust model
  • The resolve endpoint needs the same abuse controls as the other public widget endpoints (see app/api/widget/chat/route.ts for the established pattern: per-token and per-IP limits on the shared store, plus a body cap)
  • Existing token-based snippets must keep working; this is additive
  • Slugs need to be unique per deployment and editable by owner/admin only
Lingua principale
TypeScript
Stelle
16
Fork
2
Merge medio
7h 4m
PR unite (30g)
157

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di answerLoops/answerLoops

Tutte le issue di answerLoops/answerLoops

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.