The TinyPNG integration allows you to optimize images uploaded by your users into your platform. This helps you save space and ensure you maintain your hosting and storage costs under control.
Please note: You must add your Tiny PNG API to the backend, on the API Connector plugin. Once you add your API there, you can visit the Admin Dashboard from the front end of your site and enable this integration.
Setting Up your Integration
On the TinyPNG site
- Go to TinyPNG – Developer API and fill out the form there to get your API key.
- Visit your Dashboard
- On your dashboard, scroll to the API section and grab the API
On the Replit website
- replit.com to convert the API key to base64.
- replit.com (if you don’t have one).
4. Copy the code below and paste in your main.php editor. This is the white editor on the left of your screen.
Don’t forget to put your API key in place of the YOUR_API_KEY. Then hit the run code button. Then you should have your API key in a base64 format.
5. Click Run.
On your site backend
- Add the API key you got from the Replit website on the Authorization shared header.
- That's it, youre done.
- The first 500 compressions are completely Free
- The next 9,500 compressions costs $0.009 each.
- After 10,000 compressions, the cost is $0.002 each.
Updated 03 Mar 2023
Did this page help you?