-
npx @arkw init
orpnpx @arkw init
- When prompted, supply the necessary credentials:
Update nextConfig with esmExternals: 'loose'
const nextConfig = {
experimental: {
esmExternals: 'loose',
}
}
export default nextConfig;
import { createFramework } from ‘@arkw/core’
import { config } from ‘arkw.config.ts // update path accordingly
export const framework = createFramework(config)
import { framework } from ‘./framework-utils’; // update path accordingly
const GoogleConnectButton = () => {
const OAuthConnectionRoute = framework?.makeConnectURI({
name: 'Google' // Integration name
referenceId: ‘user-1’, // This is most likely your userID
clientRedirectPath: "/", // Where you want to redirect to after successful connection.
});
return (
<a href={OAuthConnectionRoute}>Connect with Google</a>
)
}
import { framework } from ‘./framework-utils’; // update path accordingly
const recordData = await framework.getIntegration('GOOGLE)?.query({
referenceId: `1`,
entityType: 'CONTACTS',
filters: {
'data.email': {
contains: 'mail',
},
},
sort: ['asc(createdAt)', 'desc(updatedAt)'],
});
const res = await framework.executeAction({
integrationName: 'GOOGLE',
action: 'SEND_EMAIL',
payload: {
data: {
to: emails,
subject,
body,
},
ctx: {
referenceId: 'user-1',
},
},
});