You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| callback |`(payload: { action: string, formId: string, fetchFormDetails: () => Promise<{}> }) => void`| Method to be called when a form is selected in Typeform Admin UI. |
101
+
| type |`"iframe" \| "popup"`| Optional. See `setDefaultConfiguration` above. |
102
+
| appName |`string`| Optional. See `setDefaultConfiguration` above. |
103
103
104
104
Example with JavaScript:
105
105
106
106
```javascript
107
107
window.tfEmbedAdmin.selectForm({
108
-
callback: ({ action, formId }) =>console.log(`you just selected form id: ${formId}`),
108
+
callback: ({ action, formId, fetchFormDetails }) =>console.log(`you just selected form id: ${formId}`),
| callback |`(payload: { action: string, formId: string, fetchFormDetails: () => Promise<{}> }) => void`| Method to be called when a form is edited in Typeform Admin UI. |
140
+
| type |`"iframe" \| "popup"`| Optional. See `setDefaultConfiguration` above. |
141
+
| appName |`string`| Optional. See `setDefaultConfiguration` above. |
142
142
143
143
Example with JavaScript:
144
144
145
145
```javascript
146
146
window.tfEmbedAdmin.editForm({
147
147
formId: myTypeformId,
148
-
callback: ({ action, formId }) =>console.log(`you just edited form id: ${formId}`),
148
+
callback: ({ action, formId, fetchFormDetails }) =>console.log(`you just edited form id: ${formId}`),
// callback function needs to be available on global scope (window)
166
166
}
167
167
</script>
168
168
```
169
169
170
+
### fetchFormDetails()
171
+
172
+
The callback receives `fetchFormDetails` async method in the payload. You can use this method to fetch details about currently selected / edited form. It returns `title`, `url` and `imageUrl` of the meta image.
0 commit comments