📃

Cheatsheet: zkForm Template

➡️

This cheatsheet contains the full zkForm template config, as well as an explanation for each parameter.

zkForm Template Config

// COPY FROM HERE

{
  // NO UPDATE. Template type
  type: "zkForm",
  // UPDATE. App information
  metadata: {
    name: "Sismo Swag Lottery", // UPDATE. Your app name
    slug: "swag-lottery", // UPDATE. Your app name in the form of a slug (no spaces allowed). It will be the last part in the URL, eg: apps.sismo.io/sismo/swag-lottery
    description:
      "Prove you are a Sismo Community member to participate in the Lottery.", // UPDATE. The description is used for SEO and social media preview of your app
    image: "sismo_zkform_swag_500x500.png", // UPDATE. Image for your app, to be placed in the images folder
    tags: ["Swag"], // UPDATE. Add one or two tags to describe your app
  	createdAt: new Date("2022-07-01T00:00:00.000Z"), // UPDATE. Edit the date here to today's date YYYY-MM-DD
  	lastUpdateAt: new Date("2022-07-01T00:00:00.000Z"), // UPDATE OR REMOVE. Edit the date here to last update date YYYY-MM-DD
  },
  // UPDATE. Sismo Connect request, see "Cheatsheet: Build Your Sismo Connect Request"
  sismoConnectRequest: {
    appId: "{{ auto-fill }}", // NO UPDATE. Sismo Connect appId is automatically created based on your app metadata
    authRequests: [{ authType: AuthType.VAULT }], // UPDATE OR REMOVE. Select auth
    claimRequests: [{ groupId: "0xc90878eaa974c31bc62c52ad86121765" }], // UPDATE OR REMOVE. Select group
  },
  // UPDATE. Config for zkForm
  templateConfig: {
    step1CtaText: "Prove you are Eligible", // UPDATE OR REMOVE. 1st step text when users click on the app, "Sign in with Sismo" by default
    step2CtaText: "Participate in the Swag Lottery", // UPDATE. 2nd step button text, on submitting the form
    appDescription: "You will prove that you are a member of Sismo Community to participate in the lottery by providing your email.", // UPDATE OR REMOVE. Description for your app
    // UPDATE OR REMOVE. Form fields
    fields: [ 
      {
        type: "short-text", // NO UPDATE. Your field type
        label: "Email", // UPDATE. Your field name
        placeholder: "Double check please!", // UPDATE OR REMOVE. Your helper text
        isRequired: true, // UPDATE OR REMOVE. Field required or not, true by default
      },
    ],
    // UPDATE OR REMOVE. Success form message
    congratulationsMessage: {
      title: "Fingers crossed!", // UPDATE. Your title
      description: "We hope to have you as a lucky winner :)", // UPDATE. Your message
    },
    // UPDATE OR REMOVE. User selection
    userSelection: { type: "Lottery", maxNumberOfEntries: 10, numberOfWinners: 10 }, // UPDATE. Your type: "Lottery" or "FCFS". If "FCFS", only use parameter "maxNumberOfUsers". See Parameters explanation below.
    // UPDATE. Data storage
    output: {
      destination: {
        type: "google_sheet", // NO UPDATE.
        spreadsheetId: "", // UPDATE. See "Add your App in the Sismo App Store"
      },
      saveAuths: true, // UPDATE OR REMOVE. Save Auths outputs in spreadsheet
      saveClaims: true, // UPDATE OR REMOVE. Save Claims outputs in spreadsheet
    },
  },
  // UPDATE OR REMOVE. App dates
  options: {
    startDate: new Date("2023-05-12T18:00"), // UPDATE OR REMOVE. Your start date YYYY-MM-DD
    endDate: new Date("2024-05-19T18:00"), // UPDATE OR REMOVE. Your end date YYYY-MM-DD
  },
},

// UNTIL HERE

Parameters Explanation

  1. type: zkForm template.
  1. metadata: app information.
    1. name: formal app name, should reflect the app's function or purpose.
    2. slug: URL-friendly "your-app-slug”, unique and descriptive, in lowercase and with hyphens. Part of the URL that refers to your specific app, eg: “apps.sismo.io/space-name/your-app-slug”.
    3. description: summary of what your app does or its purpose.
    4. image: name of your image, to be placed in images folder space-configs/images/.
    5. tags: keywords associated with your app used to classify it.
    6. createdAt: creation date for your app, eg: "2023-07-05T18:00" for a creation date on July 2023, 5 at 18:00.
    7. lastUpdateAt(optional): last update for your app, eg: "2023-07-05T18:00" for a creation date on July 2023, 5 at 18:00.
  1. sismoConnectRequest: Sismo Connect request made to users’ Data Vault. To learn how to customize this part, read
    📃
    Cheatsheet: Build Your Sismo Connect Request
  1. templateConfig config specific to zkForm, with input fields for users to complete.
    1. step1CtaText(optional): call to action. Displayed when users click on the app, before being redirected to their Data Vault to generate a proof.
    2. step2CtaText: call to action. Displayed after users return from their Data Vault with a valid proof.
    3. appDescription(optional): brief description of what to expect from your app.
    4. fields: input fields, each object represents a field form.
      1. type: "short-text", short text. Other input fields will be added in the future.
      2. label: name of the field.
      3. placeholder(optional): hint text to appear in the input field.
      4. isRequired(optional): boolean value to specify if required or not, set to true by default.
    5. congratulationsMessage(optional): success form message after users submit their data.
      1. title: headline.
      2. description: more detailed message.
    6. userSelection(optional): specify a method to select users.
      1. type: “FCFS” (First Come First Served) or “Lottery”.
      2. maxNumberOfEntries(Lottery): limit the number of users.
      3. numberOfWinners(Lottery): specify the number of winners.
      4. maxNumberOfUsers(FCFS): limit the number of users.
    7. output: output of your app.
      1. destination: where the data is stored.
        1. type: destination type, eg: "google_sheet". More types will be available.
        2. spreadsheetId: unique ID of the Google Sheets, copied from the URL of the Google Sheets.
      2. saveAuths(optional): save Auths outputs from Sismo Connect request.
      3. saveClaims(optional): save Claims outputs from Sismo Connect request.
  2. options(optional): dates of your app.
    1. startDate(optional): start date YYYY-MM-DD, eg: "2023-07-05T18:00" for July 2023, 5 at 18:00.
    2. endDate(optional): end date YYYY-MM-DD, eg: "2024-07-05T18:00" for July 2024, 5 at 18:00.
🙇
Contact us if you need help creating your Pull Request: 👉  Telegram | Discord | App Request form