MCPcopy Index your code
hub / github.com/figma/plugin-samples / startPluginWithParameters

Function startPluginWithParameters

trivia/code.ts:66–76  ·  view source on GitHub ↗
(parameters: ParameterValues)

Source from the content-addressed store, hash-verified

64
65// Start the plugin with parameters
66async function startPluginWithParameters(parameters: ParameterValues) {
67 const validatedParameters = validateParameters(parameters);
68 if (!validatedParameters) {
69 figma.notify(
70 "One of the parameters was not correctly specified. Please try again."
71 );
72 figma.closePlugin();
73 }
74 const url = createAPIUrl(validatedParameters);
75 figma.ui.postMessage({ type: "questions", url });
76}
77
78function loadCategories() {
79 figma.ui.postMessage({ type: "category", url: "https://opentdb.com/api_category.php" });

Callers 1

code.tsFile · 0.70

Calls 2

validateParametersFunction · 0.85
createAPIUrlFunction · 0.85

Tested by

no test coverage detected