Here are some useful short code snippets that you can use in any type of Blocks app. Copy, adapt the names to your app and make things work!
Get billing information for an app instance on a site. For example, the package name, information about the free trial, and more.
Learn more about pricing in Blocks.
Add this code to a web.js
file:
Import the function in your fronted code:
Use a custom panel to get the widget API properties.
Learn more about connecting panel elements to properties:
Use a custom panel to set the widget API properties.
Learn more about connecting panel elements to properties:
Create a link in a custom panel that opens the app dashboard page.
Backend:
Frontend:
Learn more about opening a dashboard page from a panel:
Create a link in a custom panel that opens the app's plan picker.
Backend:
Frontend:
Learn more about:
Get and set properties of a nested widget from a panel in the outer widget. Learn more
Expand and collapse elements in a custom panel. Learn more
Use the SDK's data module to query collections in your app.
Learn more about managing collections in Blocks: