1. OnlyFans Authentication
  2. Frontend components

OnlyFans Authentication

Frontend components

Embed the login component into your app. This can be done in a popup, or inline. Add this script tag to your page: <script src="https://auth.ofauth.com/embed.js"></script>

And initialize the login component with the init function:

        /**
 * @param {string} containerId - Element ID
 * @param {string} sessionKey - The sessionKey returned from the /init function
 * @param {Object} options - Configuration options for OFAuth
 * @param {string} [options.width='400px'] - Width of the iframe
 * @param {string} [options.border='1px solid #ccc'] - Border style of the iframe
 * @param {string} [options.borderRadius='18px'] - Border radius of the iframe
 * @param {function} [options.onSuccess] - Optional * Callback function called on successful authentication
 * @param {function} [options.onCancel] - Optional * Callback function called when authentication is cancelled
 */
OFAuthEmbed.init(containerId, sessionKey, options: {width?: '400px', border?: '1px solid #ccc', borderRadius?: '18px', onSuccess?: () => void, onCancel?: () => void} = {})

      

Soon a hosted version will be available, which will make this process even easier.