{"id":20206505,"url":"https://github.com/useflyyer/flyyer-types","last_synced_at":"2025-10-09T08:42:22.377Z","repository":{"id":38426466,"uuid":"317049750","full_name":"useflyyer/flyyer-types","owner":"useflyyer","description":"Flyyer type definition for Typescript templates created with https://github.com/useflyyer/create-flyyer-app","archived":false,"fork":false,"pushed_at":"2023-01-07T05:09:59.000Z","size":521,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-17T12:49:52.263Z","etag":null,"topics":["flyyer","og-images","react","seo","twitter-cards","typescript","vue"],"latest_commit_sha":null,"homepage":"https://www.flyyer.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/useflyyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-29T21:49:28.000Z","updated_at":"2023-10-27T20:58:36.000Z","dependencies_parsed_at":"2023-02-06T12:32:05.770Z","dependency_job_id":null,"html_url":"https://github.com/useflyyer/flyyer-types","commit_stats":null,"previous_names":["flayyer/flayyer-types"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/useflyyer/flyyer-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/useflyyer","download_url":"https://codeload.github.com/useflyyer/flyyer-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-types/sbom","scorecard":{"id":402923,"data":{"date":"2025-08-11","repo":{"name":"github.com/useflyyer/flyyer-types","commit":"4f69d11d350905bf4bdf2f3f69e56dbd50bb3616"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/useflyyer/flyyer-types/node.js.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/useflyyer/flyyer-types/node.js.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T20:30:07.586Z","repository_id":38426466,"created_at":"2025-08-18T20:30:07.586Z","updated_at":"2025-08-18T20:30:07.586Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001047,"owners_count":26082991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flyyer","og-images","react","seo","twitter-cards","typescript","vue"],"created_at":"2024-11-14T05:24:30.471Z","updated_at":"2025-10-09T08:42:22.359Z","avatar_url":"https://github.com/useflyyer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @flyyer/types\n\n![npm-version](https://badgen.net/npm/v/@flyyer/types)\n![downloads](https://badgen.net/npm/dt/@flyyer/types)\n![size](https://badgen.net/bundlephobia/minzip/@flyyer/types)\n![tree-shake](https://badgen.net/bundlephobia/tree-shaking/@flyyer/types)\n\nFlyyer type definition for Typescript templates created with [create-flyyer-app](https://github.com/useflyyer/create-flyyer-app/).\n\n**👉 Want to learn more about rendering images? Visit us at [flyyer.io](https://flyyer.io?ref=flyyer-types)**\n\n**📖 Checkout our official documentation: [docs.flyyer.io](https://docs.flyyer.io/docs/advanced/typescript?ref=flyyer-types)**\n\n## Install\n\n```sh\nnpm install --save-dev @flyyer/types\n\nyarn add --dev @flyyer/types\n```\n\n## Usage\n\nThe provided `TemplateProps\u003cT\u003e` accepts a generic object type for the possible variables passed to the template. Keep in mind not every variable is guaranteed to be present, this is the reason why every variable will be marked as _possibly undefined_.\n\n```tsx\nimport React from \"react\";\nimport { TemplateProps } from \"@flyyer/types\";\n\nexport default function SimpleTemplate({ variables }: TemplateProps) {\n  const title = variables.title; // type is `string | undefined`;\n  return (\n    \u003cdiv\u003e\n      {title \u0026\u0026 \u003ch1\u003e{title}\u003c/h1\u003e}\n    \u003c/div\u003e\n  );\n}\n```\n\nSince URL serialization converts `Date` and `number` to strings, every field type will be typed as `string | undefined`. Objects and arrays will be also typed using a recursive strategy.\n\n```tsx\nimport React from \"react\";\nimport { TemplateProps } from \"@flyyer/types\";\n\n// Example:\ntype Variables = {\n  title: string;\n  count: number;\n  price: number;\n  created: Date;\n  object: {\n    name: string;\n    age?: number;\n  };\n  array?: number[];\n}\n\nexport default function Template({ variables }: TemplateProps\u003cVariables\u003e) {\n  const {\n    title, // type is `string | undefined`\n    count, // type is `string | undefined`\n    price = 10, // type is `string | 10` because incoming values will be string!\n    createdAt, // type is `string | undefined`\n    object, // type is a recursive object with `string | undefined` values: `{ name?: string | age?: string } | undefined`\n    array, // type is a recursive array with `string | undefined` values: `(string | undefined)[] | undefined`\n  } = variables;\n\n  return (\n    \u003cdiv\u003e\n      {title \u0026\u0026 \u003ch1\u003e{title}\u003c/h1\u003e}\n    \u003c/div\u003e\n  );\n}\n```\n\nTo avoid this issue we encourage using [@flyyer/variables](https://github.com/useflyyer/flyyer-variables) which can parse and coerce types and handle default values.\n\n```tsx\nimport { Variable as V, Static } from \"@flyyer/variables\";\n\n// Example:\nexport const schema = V.Object({\n  title: V.String({ description: \"Show this on https://flyyer.io\" }),\n  count: V.Integer({ title: \"Count of items\" }),\n  price: V.Number({ default: 10.0 }),\n  createdAt: V.Optional(V.String({ format: \"date-time\" })),\n  object: V.Object({\n    name: V.String(),\n    age: V.Integer(),\n  }),\n  array: V.Array(V.Number(), { description: \"An array of numbers\" }),\n});\n\ntype Variables = Static\u003ctypeof schema\u003e;\n\nexport default function Template({ variables }: TemplateProps\u003cVariables\u003e) {\n  const {\n    data: {\n      title, // type is `string`,\n      count, // type is `number`\n      price, // type is `number`\n      createdAt, // type is `string | undefined` and a valid for `new Date(...)`\n      object, // type if the expected object type\n      array, // type is `number[]`\n    },\n  } = validator.parse(variables);\n}\n```\n\n### Platform information\n\nSometimes we can identify which platform your link are being shared on. You can get this information via the `agent` prop.\n\n```tsx\nimport React from \"react\";\nimport { TemplateProps, FlyyerAgentName } from \"@flyyer/types\";\n\nexport default function MainTemplate({ agent }: TemplateProps) {\n  if (agent.name === FlyyerAgentName.WHATSAPP) {\n    // Custom rules for squared template\n    return ...\n  } else {\n    // Default 1200x630 banner.\n    return ...\n  }\n}\n```\n\nHandle multiple locales (languages) by reading the `locale` prop. You can use some lightweight libraries to process locale internationalization (i18n) just like: [lukeed/rosetta](https://github.com/lukeed/rosetta) and [airbnb/polyglot.js](https://github.com/airbnb/polyglot.js).\n\n```tsx\nexport default function MainTemplate({ locale }: TemplateProps) {\n  if (!locale) {\n    // no locale info was provided\n  } else if (locale === \"en\") {\n    // ...\n  } else if (locale === \"es-CO\") {\n    // ...\n  }\n\n  // Native Intl module is supported ✅\n  const formatter = new Intl.DateTimeFormat(locale);\n  const humanized = formatter.format(new Date());\n}\n```\n\n\u003e NOTE: Sometimes web proxies used by crawlers ignores user's actual locale.\n\n## Import assets\n\nTo remove Typescript warning when importing files such as images, fonts, style files, etc.\nUse the following code in a `types.d.ts` file in the root of your Flyyer deck.\n\n```ts\n// types.d.ts\n\n/// \u003creference types=\"@flyyer/types/global\" /\u003e\n```\n\n## Experimental Javascript support\n\nYou can help your IDE with typing information. Here is an working but experimental example in Visual Studio Code:\n\n```js\nimport { TemplateProps } from \"@flyyer/types\"; // eslint-disable-line no-unused-vars\n\n/**\n * Make sure to default export a React component\n * @param {TemplateProps} [props] - Flyyer props.\n */\nexport default function JavascriptTemplate({ variables }) {\n  const title = variables.title; // IDE will suggest `title` has type `string | undefined`\n  // ...\n}\n```\n\n## Validate Flyyer Config\n\nThis is optional but will help your IDE with IntelliSense to autocomplete and hint you.\n\n```js\n// flyyer.config.js\nconst { config } = require(\"@flyyer/types\");\nrequire(\"dotenv\").config();\n\nmodule.exports = config({\n  engine: \"react\",\n  key: process.env.FLYYER_KEY,\n  deck: \"my-deck\",\n\n  // Optionals\n  name: \"My Deck\",\n  description: \"Lorem ipsum with **markdown**\",\n  private: false, // Make deck public on https://flyyer.io/community when `false`.\n  license: \"MIT\",\n  keywords: [\"keyword\"],\n  sizes: [\"THUMBNAIL\", \"BANNER\", \"SQUARE\", \"STORY\"], // supported sizes\n  repository: \"https://github.com/useflyyer/repository\", // show source on https://flyyer.io/community\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseflyyer%2Fflyyer-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuseflyyer%2Fflyyer-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseflyyer%2Fflyyer-types/lists"}