Quickstart
This guide will walk you through the basic steps to get you started with creating and managing your scripts on the bunny.net platform. Whether you're looking to enhance your website's performance or add custom functionality, Edge Scripting makes it easy and efficient.
What you'll need
Before you dive in, make sure you have the following prerequisites in place:
- A bunny.net account ( Log in or sign up for a free trial).
With these prerequisites in place, you're ready to start using Edge Scripting. Follow the steps below to create, customize, and manage your scripts effectively.
Creating your first script
To create your first script, follow the steps outlined below:
- Login to bunny.net dashboard.
- Navigate to Edge Platform > Scripting and click Add Script.
- Provide a name for your script, select Standalone type and then Default standalone template.
Note
To learn more about differences between Standalone and Middleware, see our script types documentation.
- Click Add script.
- An underlying pull zone is automatically set up for your script, making it accessible from the outside through a unique URL. Your new script starts with a placeholder function that issues a simple "Hello from" when accessed through its URL.
The bottom left panel is a preview pane where you can input a URL and execute the script currently open in the editor. Executing the script here doesn't alter the actual deployed script, allowing you to safely test and refine your code before publishing. You can initiate the script execution via a play button within this pane, making it a practical tool for real-time testing and verification of how the script behaves.
On the bottom right, the dashboard includes a logs pane. This pane captures and displays output from any console.log calls made by the script when it is run in the preview pane.
It serves as a crucial debugging aid, providing real-time insights into the script’s performance and helping you identify any issues or confirm operations through the log outputs. This logs pane is an essential component for optimizing your scripts based on detailed feedback from test runs.
- Edit your script to customize its functionality. You can replace the placeholder with your desired code. You can use the provided URL to test your script and ensure your changes work as expected.
- When you are happy with your script, click Save and Publish.
Once you save and publish your changes, they are applied immediately, allowing for real-time updates and modifications.
Need help or encountered issues?
If you encounter any difficulties or have questions while following this guide, our support team is here to assist you. Please don't hesitate to contact us via the support request form for prompt assistance.
Our dedicated support team is ready to help you resolve any issues you might face during the deployment process, provide additional guidance, or answer your questions.
Updated about 2 months ago