To use the Fotor AI Editor SDK, you first need to obtain a Fotor API Key. Please refer to the How to Obtain an API Key guide for detailed instructions.
To ensure security, it is recommended to handle the API Key on the server side and generate temporary tokens for frontend use. Follow these steps:
1.
Implement a Server-Side Endpoint:
Create an endpoint on your server that authenticates users based on your system and exchanges the obtained API Key for a temporary token from Fotor (refer to Get Sdk Temporary Token).
2.
Ensure Sufficient Available Tokens:
Make sure your account has enough tokens available for usage.
3.
Security Recommendation:
It is strongly advised not to hardcode the API Key in frontend code to prevent exposure.
Embed Fotor AI Editor’s editing functionalities into your project.
Note: Please replace the getToken function in the above code with your own logic for obtaining a temporary token to ensure security and proper functionality.You have now successfully integrated the Fotor AI Editor SDK!