Skip to main content
This guide takes you from zero to a working upload gate. You will embed the Element, block your submit button until a file passes, and learn where to verify the result server-side.

Prerequisites

Before you begin, you need:
  • A Filecheck account (sign up).
  • A publishable key (pk_live_… or pk_test_…). See Authentication.
  • A Workflow configured in the admin, which gives you a workflowId (wf_…). See Workflows.

Get started

1

Add the Element to your page

Load the script and add a mount point where the widget should appear.
<script src="https://cdn.filecheck.io/element/v1/filecheck.js"></script>

<div id="fc-slot"></div>
<button id="checkout" disabled>Add to cart</button>
Loading the script without async means window.Filecheck is ready for the inline script below. For async loading, see Installation.
2

Mount the Element and gate your button

Create an intake element for your Workflow, mount it, and disable the submit button until canProceed is true.
<script>
  const fc = Filecheck('pk_live_…');

  const intake = fc.elements.create('intake', {
    workflowId: 'wf_…',
    presentation: 'inline'
  });

  intake.mount('#fc-slot');

  intake.on('status', ({ canProceed, jobId }) => {
    document.querySelector('#checkout').disabled = !canProceed;
    document.querySelector('#fc-job-id').value = jobId ?? '';
  });
</script>
The option is workflowId (a wf_… id), not ruleId. Gate on canProceed directly. Do not re-derive it from status or files. See Status payload.
3

Persist the job and verify server-side

Write the jobId into a hidden field, attach it to the order, then use your secret key to fetch the result after purchase.
curl https://api.filecheck.io/jobs/{jobId} \
  -H "Authorization: Bearer sk_live_…"
See Verify jobs.

Next steps

Use a no-code plugin

WooCommerce, Shopify, OpenCart, and PrestaShop.

Element API

All create options, methods, and events.
Need help? Reach out at support@filecheck.io.