사용 방법
Worker는 한 번만 배포하면 됩니다. 같은 Worker에 여러 Widget ID를 저장하고 각각 /<id>.svg로 사용할 수 있습니다.
-
위젯을 디자인합니다
네 모서리 문구, 색상, 날짜, 배경, 프레임을 설정합니다.
{days}는 종료일로부터 지난 일수로 자동 치환됩니다. -
배경 이미지를 준비합니다
Local image는 브라우저 미리보기와 200×40 WebP 내보내기용입니다. 실제 배포 위젯에 배경을 넣으려면 공개 HTTPS 이미지 주소를 Hosted image URL에 넣습니다.
-
Admin token을 만듭니다
Generate token을 누르고 토큰을 보관합니다.
ADMIN_TOKEN은 Builder의 위젯 생성·수정·삭제 권한을 보호합니다. -
Worker를 배포합니다
Deploy Worker를 눌러 Worker 템플릿을 Cloudflare에 배포합니다. Worker 하나가 여러 위젯을 담당합니다.
-
Cloudflare Secret을 확인합니다
배포된 Worker에서 아래 Secret을 확인합니다. 배포 과정에서 자동으로 묻지 않았거나 값이 없다면 직접 추가합니다.
Worker → Settings → Variables and SecretsADMIN_TOKEN- Builder에서 생성한 Admin token과 동일한 값
DATA_TOKEN- 실시간 데이터 연동용 별도 랜덤 토큰. 실시간 연동을 쓰지 않아도 등록해 둘 수 있습니다.
-
Worker 주소를 Builder에 연결합니다
Worker base URL에 배포된 Worker 주소를 넣고, Admin token에는 같은
ADMIN_TOKEN값을 입력합니다.https://your-worker.workers.dev
또는https://widgets.example.com -
위젯을 Publish합니다
Widget ID를 정하고 Publish / Update this ID를 누릅니다. 같은 ID를 다시 Publish하면 기존 위젯이 업데이트됩니다.
qurare→https://widgets.example.com/qurare.svg
ADMIN_TOKEN, DATA_TOKEN은 공개 저장소, 위젯 URL, SVG 안에 넣지 마세요. 공개 SVG를 보는 사람에게는 토큰이 필요하지 않습니다.
How to use
Deploy the Worker once. One Worker can store multiple Widget IDs and serve each one as /<id>.svg.
-
Design your widget
Configure the four corner strings, colors, date, background, and frame.
{days}is replaced with elapsed days automatically. -
Prepare the background
Local image is only for browser preview and exporting a 200×40 WebP. For a deployed background, set Hosted image URL to a public HTTPS image.
-
Create an Admin token
Click Generate token and keep it safe.
ADMIN_TOKENprotects create, update, and delete operations from the Builder. -
Deploy the Worker
Click Deploy Worker and deploy the template to Cloudflare. One deployment can host many widgets.
-
Check Cloudflare Secrets
Verify these Secrets on the deployed Worker. If the deploy flow did not ask for them, add them manually.
Worker → Settings → Variables and SecretsADMIN_TOKEN- The same Admin token generated in the Builder
DATA_TOKEN- A separate random token for trusted live-data writers
-
Connect the Worker to the Builder
Enter the deployed Worker address in Worker base URL, then enter the same
ADMIN_TOKENin Admin token.https://your-worker.workers.dev
orhttps://widgets.example.com -
Publish the widget
Choose a Widget ID and click Publish / Update this ID. Publishing the same ID again updates it.
qurare→https://widgets.example.com/qurare.svg
Never put ADMIN_TOKEN or DATA_TOKEN in a public repository, widget URL, or SVG. Public viewers of the SVG do not need either token.