Files
twenty/packages/twenty-zapier/src/authentication.ts
T
martmull e6a415b438 Fix twenty zapier (#18191)
as title
2026-02-25 10:35:46 +01:00

40 lines
977 B
TypeScript

import type { Bundle, ZObject } from 'zapier-platform-core';
import requestDb from 'src/utils/requestDb';
const testAuthentication = async (z: ZObject, bundle: Bundle) => {
return await requestDb({
z,
bundle,
query: 'query currentWorkspace {currentWorkspace {id displayName}}',
endpoint: 'metadata',
});
};
export default {
type: 'custom',
test: testAuthentication,
fields: [
{
computed: false,
key: 'apiKey',
required: true,
label: 'Api Key',
type: 'string',
helpText:
'Create an API key in [your twenty workspace](https://app.twenty.com/settings/apis)',
},
{
computed: false,
key: 'apiUrl',
required: false,
label: 'Self hosted instance url',
type: 'string',
placeholder: 'https://crm.custom-url.com',
helpText: 'Set this only if you self-host Twenty',
},
],
connectionLabel: '{{data.currentWorkspace.displayName}}',
customConfig: {},
};