Accessing the Syrinscape API with javascript

Hi guys

I already wrote @benjamin about this, but I decided to write in here, as maybe someone else had the same problem and already solved it.

I am currently trying to build a remote control for Syrinscape, that I can integrate into foundryvtt (, therefore I am trying to access the API with javascript.
While I can get the play and stop functions to run without problems, I cannot read from the API remotely.

Here is my basic fetch command (replace AUTH with the Auth token)

.then((response) => {
return response.json();
.then((data) => {
generates an error:

“Access to fetch at ' from origin ‘’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.”

when I now set the mode to no-cors, i only get the opaque response with no data in it.
Can anyone point me the right way, so I can access the API from a 3rd party script?

Thanks in advance.

@sonofconan Any thoughts?

When I route the request through a CORS Proxy like: I can access the data just fine

I might have found a workaround. i can build all the links I need when I have the Auth key and the information provided in syrinscape_remote_control_links_Sven_.csv
Either i can use the public version, or I have to do regular updates of my scripts manually.
A Public version would of course be easier :slight_smile:

I’m really glad someone’s building this! I’ve been putting sound links I want to use in journal entries and individual macros manually, and that works well for a scene or very often used sounds. But, I’d prefer something purpose-built in the long run.

It’s my first foray into proper coding. But i managed to parse the csv. So I might get a prototype running soon.

I’d be happy to help test if you need a guinea pig.

1 Like

I hit a small milestone today. I managed to create a module that reads in the csv and outputs the values to the console.
Not much but baby steps :smiley:


Im super interested in this and your work here.


I was a bit busy the last few days, so I didn’t make much progress. I will have some time off soon though and I plan to use that to continue on the module.

Just keep in mind that this is only a remote. It won’t be able to pipe audio into fvtt directly. That would need a way to add your own player and AFAIK this isn’t planned yet.

1 Like

Small Update:

I got the Parsing off the CSV down, now I need to create the control menus from that data:

  • Using Categories as filters for Soundsets
  • Using the Soundset as Filter for Moods
  • Generating the Links for each Mood
  • Generating a Stop Button (I think I need to use the Silence Soundset for that)
  • Building a nice Menu around all that.

I would also love to find a way, so i can add the Soundsets to Journal Entries and the like in order to start them Quickly.

I shall keep posting updates here.


Thanks for the update @chrome it’s looking really promising :slight_smile:

1 Like

Hello, I’m a Senior Software Engineer. I’m interested I’m helping. I build APIs.



Grab us at support at syrinscape dot com and we’ll set you up with the info you need. :slight_smile:

1 Like

Any updates on this? I am eager to try out whatever anyone might have in the works.

Unfortunately I still lack the skill to work with the API as it is right now. I placed my findings in the hands of some other Foundry Devs - hopefully they will be able to pick up th torch.

A few others have picked up the torch and eadorin (patreon “Foundry Workshop”) has a basic mod working (still in alpha), but unfortunately there is no current support for turning Foundry into a minion that broadcasts the sound output by the DM’s Syrinscape Online Player. One can make an interface / GUI in Foundry that allows one to duplicate the functionality of the Master Interface (so you don’t have to switch tabs to change sounds, though you do have to manage an additional window within Foundry). Your players, though, still have to have an Online Player downloaded and connected to your Syrinscape instance, and that Control Panel / Online Player manages things like syncronicity and runs in addition to Foundry.

It’s disappointing to be sure, given the issues a lot of us have with our players struggling around the Online Player / connecting to the DM / a-sync issues / dropped-sounds, but that is where things stand at present.


I’ve been working on a custom remote much like the OP, and run into the same CORS issues. I am not a javascript developer, so I’m on a bit of a learning curve - apologies if I ask a stupid question!

It seems (from the little I understand!) that any XHR request from javascript will not be able to return a response - is that right?

Is it possible to consider relaxing the CORS policy, at least for some request URLs? I’m hoping that maybe @sonofconan will be able to give some pointers, if it’s not a bother!


@yamahito that’s correct. I’ll reply here where we have made the necessary changes on our end to relax CORS requirements. But I can’t say when that might be.

In the meantime, you would need to implement your own local proxy. For example a Python web server that handles your requests and then makes its own request to our server directly without CORS restrictions, or the Node.js proxy linked to earlier in this thread:

1 Like

Thanks for the quick reply!

I’ll have a think about the node.js proxy, but as it may require more hosting, I may just try to be patient :wink:

1 Like