Kirby as form endpoint for external frontends

Probably a super simple question: Is it possible to let my kirby website serve as a form-endpoint for externally hosted frontend-projects (nuxt-based)? I’m not so handy with the rest api… And not sure how to acces it from an external frontend. I’ve tried to hook into kirby with axios in my nuxt-app, but I’m not sure if that’s the right way.

Hi, we currently use forms in this way from a nuxt frontend too.

Without sharing any code we achieved it by making a plugin used for sending emails only.

The plugin has an endpoint such as api/mail/transactional which accepts a post request. We have this endpoint behind basic auth to prevent abuse and in our case we send a request to a Netlify lambda function which in turn calls Kirby.

This way we can make use of Kirby email templates and whatnot.

It works really well, if you wanted any help setting it up feel free to ask any questions and ill try my best to answer.

PS - in Nuxt we would do the following:

		methods: {
			async submit() {
                await this.$axios.$post('api url here', { 
                    // FORM data goes here
                } .then(response => {
                    // Deal with your response here
                .catch(error => {
                    // deal with any errors here

That’s super helpful! I was already aware of the basics but couldn’t figure out how these elements exactly linked up. The axios method is the same as mine. Thanks for the quick reply :blush:

Cool, if you would like to see our implementation just drop me a private message and I’ll share how ours works.