Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose user editable settings on the Settings page via the SDK #9

Open
proudparrot2 opened this issue Aug 22, 2024 · 1 comment
Open
Assignees

Comments

@proudparrot2
Copy link
Member

No description provided.

@Cattn Cattn added this to Todo Aug 22, 2024
@proudparrot2 proudparrot2 self-assigned this Aug 22, 2024
@proudparrot2 proudparrot2 converted this from a draft issue Aug 22, 2024
@proudparrot2
Copy link
Member Author

proudparrot2 commented Aug 22, 2024

In the SDK, developers will be able to expose and bind config options as user-editable settings in the Settings page. They'll be able to choose the field name, description, and type of input (text, check, select). This will directly set the configuration value for the key they choose to the data the user inputs.

const plugin = {
  onReady(sdk) {
    sdk.exposeSetting({
      bind: "name",
      title: "Name",
      description: "Enter your name",
      type: "text",
    })
  },

  tile(sdk) {
    return <p>{sdk.config.get("name")}</p>
  }
}
interface ExposeSettingProps {
  key: string
  data: {
    title: string
    description?: string,
    type: "text" | "select" | "checkbox",
    options?: { // for type "select"
      title: string
      value: string
    }[]
  }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress: Parrot
Development

No branches or pull requests

1 participant