Readme

Figma plugin statistics collector

I develop two Figma plugins - one that lets you create vector street maps in Figma and one that lets you generate vector globes. It's fun to watch them get some usage, but the Figma community site is pretty barebones.

This uses one of the APIs on the Community page as an unofficial API and collects results in Val Town SQLite. You can see a chart of the resulting data on Observable.

Runs every 3 hrs
Fork
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
export default async function(interval: Interval) {
const versions = await fetch("https://www.figma.com/api/plugins/1323092380415927575/versions").then(r => r.json());
const { install_count, like_count, view_count } = versions.meta.plugin;
const result = await sqlite.execute(`
INSERT INTO plugin_stats (name, install_count, like_count, view_count) VALUES
('placemark-globe', ${install_count}, ${like_count}, ${view_count})`);
{
const versions = await fetch("https://www.figma.com/api/plugins/1189962635826293304/versions").then(r => r.json());
const { install_count, like_count, view_count } = versions.meta.plugin;
const result = await sqlite.execute(`
INSERT INTO plugin_stats (name, install_count, like_count, view_count) VALUES
('placemark', ${install_count}, ${like_count}, ${view_count})`);
}
return result;
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.