1

I am trying to update a file named blues.cts because a function named fetchAllPacks uses it to update the client. I was wondering if, without updating the functions, I could update the JSON data in that file? The following is blues.cts that I would like to update. It has this data object, interfaces, and a few functions.

export const data = {
    "specials": {
        "Alien Cat": {
            "cost": 0,
            "bluedata": "Alien Cat",
...

This is my functions script, and I see there is no need to update this function.

export const fetchAllPacks = onCall({enforceAppCheck: true}, async (req) => {
    if (req.auth == null) {return {success: false, error: ReturnError.auth.invalid}}
    return {success:true, packs: shop.getAllPacks()};
});

1 Answer 1

1

Firebase doesn't support the modification of any files that were previously deployed by the CLI, whether or not the file contains code, or JSON, or something else. All that data is baked into a docker image that can't be modified after deployment. If you want to change the file, you have to do that locally, then deploy the function again.

If you want the ability to dynamically update some data that would be used by your function at runtime without redeployment, you should consider storing that data in a place that can be queried by your function code, such as Cloud Storage or some database.

Sign up to request clarification or add additional context in comments.

1 Comment

I do have Remote Config setup, so I may look into doing that. Thanks for your answer, I'll mark it as solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.