Web Integration
On this page you'll find integration guides for web platforms. Use the tabs to pick your framework.
- React
- Next.js
React Integration
You will get the redirectUrl after the Consent Creation API call.
redirectUrl: https://staging.indiaconsent.com/consent?cr_id=c8ab306d-0a53-4af1-9f3c-c4662df39500
React Basic Implementation
import { useEffect } from 'react';
export default function ConsentWidget() {
useEffect(() => {
window.open(redirectUrl, 'consentWindow', 'width=500,height=600');
}, []);
return null;
}
Next.js Integration
You will get the redirectUrl after the Consent Creation API call.
redirectUrl: https://staging.indiaconsent.com/consent?cr_id=c8ab306d-0a53-4af1-9f3c-c4662df39500
Next.js Basic Implementation
'use client';
import { useEffect } from 'react';
export default function ConsentWidget() {
useEffect(() => {
window.open(redirectUrl, 'consentWindow', 'width=500,height=600');
}, []);
return null;
}