diff --git a/clients/client-cocoa/README.md b/clients/client-cocoa/README.md index ff57475..d563778 100644 --- a/clients/client-cocoa/README.md +++ b/clients/client-cocoa/README.md @@ -35,6 +35,36 @@ client.fetchFlags(fileName: "features.json", fetchCompletionHandler: { flags, er ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types cocoa REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `Should` be on. @@ -67,7 +97,7 @@ client.fetchFlags(fileName: "features.json", fetchCompletionHandler: { flags, er ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -78,34 +108,32 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `Should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-cocoa/README.toml b/clients/client-cocoa/README.toml index 1697341..5db8f5f 100644 --- a/clients/client-cocoa/README.toml +++ b/clients/client-cocoa/README.toml @@ -6,7 +6,7 @@ Add VexillaClient as a dependency via Swift Packages ''' CustomInstanceHash = "customInstanceHash" -FetchFlags = "fetchFlags" +SyncFlags = "fetchFlags" SetupSnippet = ''' ```swift var client = VexillaClient(environment: "dev", baseUrl: "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", customInstanceHash: userId) @@ -19,7 +19,7 @@ client.fetchFlags(fileName: "features.json", fetchCompletionHandler: { flags, er } client.setFlags(flags: flags!) - + )} ``` ''' @@ -41,7 +41,7 @@ client.fetchFlags(fileName: "features.json", fetchCompletionHandler: { flags, er } client.setFlags(flags: flags!) - + if client.should(FEATURE_NAME) { // Do the thing } diff --git a/clients/client-csharp/README.md b/clients/client-csharp/README.md index 7270adb..1f50115 100644 --- a/clients/client-csharp/README.md +++ b/clients/client-csharp/README.md @@ -33,7 +33,7 @@ nuget install Vexilla.Client -OutputDirectory packages You will need to create a Client within your app. This optionally takes in the `customInstanceHash` for use with gradual rollout. -After creation, call `FetchFlags`. This can be chained from the constructor since it returns the client instance. +After creation, call `SyncFlags`. This can be chained from the constructor since it returns the client instance. ```csharp var httpClient = new HttpClient() @@ -41,14 +41,44 @@ VexillaHasher client = new VexillaClient( 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', process.env.ENVIRONMENT, userId -); +) -var flags = await client.FetchFlags("features.json", httpClient); +let flags = await client.SyncFlags("features.json", httpClient); ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types csharp REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage -Use the created client to check if a feature `should` be on. +Use the created client to check if a feature `Should` be on. ```csharp client.Should(FEATURE_NAME); @@ -57,21 +87,21 @@ client.Should(FEATURE_NAME); ### Full Example ```csharp -var httpClient = new HttpClient(); +var httpClient = new HttpClient() var client = new VexillaClient( 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', process.env.ENVIRONMENT, userId -); -var flags = FetchFlags("features.json", httpClient); -client.SetFlags(flags); +) +var flags = SyncFlags("features.json", httpClient); +client.SetFlags(flags) var useIsAllowed = client.Should(FEATURE_NAME); ``` ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -82,31 +112,29 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/clients/client-csharp/README.toml b/clients/client-csharp/README.toml index 33b480b..ec0c642 100644 --- a/clients/client-csharp/README.toml +++ b/clients/client-csharp/README.toml @@ -23,7 +23,7 @@ nuget install Vexilla.Client -OutputDirectory packages ''' CustomInstanceHash = "customInstanceHash" -FetchFlags = "FetchFlags" +SyncFlags = "SyncFlags" SetupSnippet = ''' ```csharp var httpClient = new HttpClient() @@ -33,7 +33,7 @@ VexillaHasher client = new VexillaClient( userId ) -let flags = await client.FetchFlags("features.json", httpClient); +let flags = await client.SyncFlags("features.json", httpClient); ``` ''' Should = "Should" @@ -50,7 +50,7 @@ var client = new VexillaClient( process.env.ENVIRONMENT, userId ) -var flags = FetchFlags("features.json", httpClient); +var flags = SyncFlags("features.json", httpClient); client.SetFlags(flags) var useIsAllowed = client.Should(FEATURE_NAME); diff --git a/clients/client-dart/README.md b/clients/client-dart/README.md index 1d211d9..a55c881 100644 --- a/clients/client-dart/README.md +++ b/clients/client-dart/README.md @@ -8,7 +8,6 @@ To get started is easy. ### Installation - Add the client pubspec.yaml. ```yaml @@ -30,7 +29,6 @@ You will need to create a Client within your app. This optionally takes in the ` After creation, call `fetchFlags`. This can be chained from the constructor since it returns the client instance. - ```dart var client = VexillaClient( 'dev', @@ -43,11 +41,40 @@ client.setFlags(flags); ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types dart REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `should` be on. - ```dart var shouldGradual = client.should(FEATURE_NAME) ``` @@ -55,7 +82,6 @@ var shouldGradual = client.should(FEATURE_NAME) ### Full Example - ```dart var client = VexillaClient( 'dev', @@ -74,7 +100,7 @@ if (client.should('FEATURE_NAME')) { ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -85,34 +111,32 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -2. You add environments to the Config UI. - -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. +## Contributing -5. Your applications include a client library as a dependency and the client consumes the JSON config. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -6. Finally your application uses the client you created to determine if a feature `should` be on. - -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-dart/README.toml b/clients/client-dart/README.toml index 78e25b0..e5cca79 100644 --- a/clients/client-dart/README.toml +++ b/clients/client-dart/README.toml @@ -16,7 +16,7 @@ dependencies: ``` ''' CustomInstanceHash = "customInstanceHash" -FetchFlags = "fetchFlags" +SyncFlags = "fetchFlags" SetupSnippet = ''' ```dart var client = VexillaClient( diff --git a/clients/client-elixir/README.md b/clients/client-elixir/README.md index 6ac268f..994c6b8 100644 --- a/clients/client-elixir/README.md +++ b/clients/client-elixir/README.md @@ -18,6 +18,8 @@ defp deps do ] ``` + + ### Setup You will need to create a Client within your app. This optionally takes in the `custom_instance_id` for use with gradual rollout. @@ -28,6 +30,37 @@ After creation, call `fetch_flags`. This can be chained from the constructor sin ``` + +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types elixir REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `should?` be on. @@ -36,15 +69,17 @@ Use the created client to check if a feature `should?` be on. ``` + ### Full Example ```elixir ``` + ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -55,34 +90,32 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -2. You add environments to the Config UI. - -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. +## Contributing -5. Your applications include a client library as a dependency and the client consumes the JSON config. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -6. Finally your application uses the client you created to determine if a feature `should?` be on. - -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-elixir/README.toml b/clients/client-elixir/README.toml index 7c4d3d7..7c6364f 100644 --- a/clients/client-elixir/README.toml +++ b/clients/client-elixir/README.toml @@ -13,7 +13,7 @@ defp deps do ''' CustomInstanceHash = "custom_instance_id" -FetchFlags = "fetch_flags" +SyncFlags = "fetch_flags" SetupSnippet = ''' ```elixir diff --git a/clients/client-go/README.md b/clients/client-go/README.md index 10a0c6d..2f0494a 100644 --- a/clients/client-go/README.md +++ b/clients/client-go/README.md @@ -14,17 +14,16 @@ Add the client to your imports. import "github.com/vexilla/client-go" ``` - ### Setup You will need to create a Client within your app. This optionally takes in the `CustomInstanceHash` for use with gradual rollout. -After creation, call `FetchFlags`. This can be chained from the constructor since it returns the client instance. +After creation, call `SyncFlags`. This can be chained from the constructor since it returns the client instance. ```go client := NewVexillaClient("dev", "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", userId) -flags, err := client.FetchFlags("features.json") +flags, err := client.SyncFlags("features.json") if err != nil { tester.Fatal(err) } @@ -32,6 +31,35 @@ if err != nil { client.SetFlags(flags) ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types go REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) ### Usage @@ -41,13 +69,12 @@ Use the created client to check if a feature `Should` be on. shouldGradual := client.should(FEATURE_NAME) ``` - ### Full Example ```go client := NewVexillaClient("dev", "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", userId) -flags, err := client.FetchFlags("features.json") +flags, err := client.SyncFlags("features.json") if err != nil { tester.Fatal(err) } @@ -59,10 +86,9 @@ if client.Should(FEATURE_NAME) { } ``` - ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -73,31 +99,29 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `Should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/clients/client-go/README.toml b/clients/client-go/README.toml index 54048d0..6fe7a2b 100644 --- a/clients/client-go/README.toml +++ b/clients/client-go/README.toml @@ -8,12 +8,12 @@ import "github.com/vexilla/client-go" ``` ''' CustomInstanceHash = "CustomInstanceHash" -FetchFlags = "FetchFlags" +SyncFlags = "SyncFlags" SetupSnippet = ''' ```go client := NewVexillaClient("dev", "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", userId) -flags, err := client.FetchFlags("features.json") +flags, err := client.SyncFlags("features.json") if err != nil { tester.Fatal(err) } @@ -31,7 +31,7 @@ Example = ''' ```go client := NewVexillaClient("dev", "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", userId) -flags, err := client.FetchFlags("features.json") +flags, err := client.SyncFlags("features.json") if err != nil { tester.Fatal(err) } diff --git a/clients/client-js/README.md b/clients/client-js/README.md index 75e0a01..328db28 100644 --- a/clients/client-js/README.md +++ b/clients/client-js/README.md @@ -37,6 +37,36 @@ this.client.getFlags('features.json'); ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types js REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `should` be on. @@ -72,7 +102,7 @@ export class FeatureFlagsService { ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -83,35 +113,32 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -ARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-js/README.toml b/clients/client-js/README.toml index 82c29e2..2560f33 100644 --- a/clients/client-js/README.toml +++ b/clients/client-js/README.toml @@ -14,7 +14,7 @@ yarn add @vexilla/client ``` ''' CustomInstanceHash = "customInstanceHash" -FetchFlags = "fetchFlags" +SyncFlags = "fetchFlags" SetupSnippet = ''' ```javascript this.client = new VexillaClient({ diff --git a/clients/client-kotlin/README.md b/clients/client-kotlin/README.md index 3775c55..c23bb99 100755 --- a/clients/client-kotlin/README.md +++ b/clients/client-kotlin/README.md @@ -30,6 +30,36 @@ val client = Client( ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types kotlin REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `should` be on. @@ -56,7 +86,7 @@ if client.should(FEATURE_NAME) { ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -67,35 +97,32 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -M, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-kotlin/README.toml b/clients/client-kotlin/README.toml index ce47371..bb3dcdd 100644 --- a/clients/client-kotlin/README.toml +++ b/clients/client-kotlin/README.toml @@ -8,7 +8,7 @@ Add the client to your imports. ``` ''' CustomInstanceHash = "customInstanceHash" -FetchFlags = "fetchFlags" +SyncFlags = "fetchFlags" SetupSnippet = ''' ```kotlin val client = Client( diff --git a/clients/client-lua/README.md b/clients/client-lua/README.md index ede6194..eca3f0c 100644 --- a/clients/client-lua/README.md +++ b/clients/client-lua/README.md @@ -33,6 +33,36 @@ client:set_flags(flags) ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types lua REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `Should` be on. @@ -61,7 +91,7 @@ end ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -72,34 +102,32 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `Should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-lua/README.toml b/clients/client-lua/README.toml index 03da27c..d6c3c0a 100644 --- a/clients/client-lua/README.toml +++ b/clients/client-lua/README.toml @@ -11,7 +11,7 @@ dependencies = { ``` ''' CustomInstanceHash = "custom_instance_hash" -FetchFlags = "fetch_flags" +SyncFlags = "fetch_flags" SetupSnippet = ''' ```lua client = Client.new({}, "dev", "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", userId) diff --git a/clients/client-php/README.md b/clients/client-php/README.md new file mode 100644 index 0000000..8eb07d2 --- /dev/null +++ b/clients/client-php/README.md @@ -0,0 +1,147 @@ +# Vexilla Client - JS/TS + +This is the JS/TS client library for Vexilla, a static file based feature flag system. + +## Getting Started + +To get started is easy. + +### Installation + + +FOOOOOOO + +Using npm or yarn, install the package. Typescript types are shipped with it. + +```sh +npm install --save @vexilla/client +``` + +or + +```sh +yarn add @vexilla/client +``` + + +### Setup + +You will need to create a Client within your app. This optionally takes in the `customInstanceHash` for use with gradual rollout. + +After creation, call `fetchFlags`. This can be chained from the constructor since it returns the client instance. + +```javascript +this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId +}); +this.client.getFlags('features.json'); +``` + + +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types js REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + +### Usage + +Use the created client to check if a feature `should` be on. + +```javascript +client.should(FEATURE_NAME) +``` + + +### Full Example + +```javascript +import { VexillaClient } from '@vexilla/client'; + +export class FeatureFlagsService { + private client; + + constructor() { + this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId + }); + this.client.getFlags('features.json'); + } + + should(featureName) { + return this.client?.should(featureName); + } +} +``` + + +## What are Feature Flags? + +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. + +See more about them here: + +- [https://featureflags.io](https://featureflags.io) +- [https://en.wikipedia.org/wiki/Feature_toggle](https://en.wikipedia.org/wiki/Feature_toggle) + +Feature Flags are also a fundamental building block for things such as A/B testing. + +## How does it work? + +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). + +## Contributing + +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. + +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). + +## Support + +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). + +## Sponsors + +No sponsors yet. This could be a link and icon for **your** company here. + +## LICENSE + +MIT + +Copyright 2023 Vexilla + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-php/README.toml b/clients/client-php/README.toml new file mode 100644 index 0000000..d4a83e5 --- /dev/null +++ b/clients/client-php/README.toml @@ -0,0 +1,58 @@ +LanguageName = 'js' +LanguageDisplayName = "JS/TS" +InstallInstructions = ''' + +FOOOOOOO + +Using npm or yarn, install the package. Typescript types are shipped with it. + +```sh +npm install --save @vexilla/client +``` + +or + +```sh +yarn add @vexilla/client +``` +''' +CustomInstanceHash = "customInstanceHash" +SyncFlags = "fetchFlags" +SetupSnippet = ''' +```javascript +this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId +}); +this.client.getFlags('features.json'); +``` +''' +Should = "should" +UsageSnippet = ''' +```javascript +client.should(FEATURE_NAME) +``` +''' +Example = ''' +```javascript +import { VexillaClient } from '@vexilla/client'; + +export class FeatureFlagsService { + private client; + + constructor() { + this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId + }); + this.client.getFlags('features.json'); + } + + should(featureName) { + return this.client?.should(featureName); + } +} +``` +''' \ No newline at end of file diff --git a/clients/client-python/README.md b/clients/client-python/README.md new file mode 100644 index 0000000..8eb07d2 --- /dev/null +++ b/clients/client-python/README.md @@ -0,0 +1,147 @@ +# Vexilla Client - JS/TS + +This is the JS/TS client library for Vexilla, a static file based feature flag system. + +## Getting Started + +To get started is easy. + +### Installation + + +FOOOOOOO + +Using npm or yarn, install the package. Typescript types are shipped with it. + +```sh +npm install --save @vexilla/client +``` + +or + +```sh +yarn add @vexilla/client +``` + + +### Setup + +You will need to create a Client within your app. This optionally takes in the `customInstanceHash` for use with gradual rollout. + +After creation, call `fetchFlags`. This can be chained from the constructor since it returns the client instance. + +```javascript +this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId +}); +this.client.getFlags('features.json'); +``` + + +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types js REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + +### Usage + +Use the created client to check if a feature `should` be on. + +```javascript +client.should(FEATURE_NAME) +``` + + +### Full Example + +```javascript +import { VexillaClient } from '@vexilla/client'; + +export class FeatureFlagsService { + private client; + + constructor() { + this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId + }); + this.client.getFlags('features.json'); + } + + should(featureName) { + return this.client?.should(featureName); + } +} +``` + + +## What are Feature Flags? + +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. + +See more about them here: + +- [https://featureflags.io](https://featureflags.io) +- [https://en.wikipedia.org/wiki/Feature_toggle](https://en.wikipedia.org/wiki/Feature_toggle) + +Feature Flags are also a fundamental building block for things such as A/B testing. + +## How does it work? + +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). + +## Contributing + +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. + +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). + +## Support + +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). + +## Sponsors + +No sponsors yet. This could be a link and icon for **your** company here. + +## LICENSE + +MIT + +Copyright 2023 Vexilla + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/clients/client-python/README.toml b/clients/client-python/README.toml new file mode 100644 index 0000000..d4a83e5 --- /dev/null +++ b/clients/client-python/README.toml @@ -0,0 +1,58 @@ +LanguageName = 'js' +LanguageDisplayName = "JS/TS" +InstallInstructions = ''' + +FOOOOOOO + +Using npm or yarn, install the package. Typescript types are shipped with it. + +```sh +npm install --save @vexilla/client +``` + +or + +```sh +yarn add @vexilla/client +``` +''' +CustomInstanceHash = "customInstanceHash" +SyncFlags = "fetchFlags" +SetupSnippet = ''' +```javascript +this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId +}); +this.client.getFlags('features.json'); +``` +''' +Should = "should" +UsageSnippet = ''' +```javascript +client.should(FEATURE_NAME) +``` +''' +Example = ''' +```javascript +import { VexillaClient } from '@vexilla/client'; + +export class FeatureFlagsService { + private client; + + constructor() { + this.client = new VexillaClient({ + baseUrl: 'https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com', + environment: process.env.ENVIRONMENT, + customInstanceHash: userId + }); + this.client.getFlags('features.json'); + } + + should(featureName) { + return this.client?.should(featureName); + } +} +``` +''' \ No newline at end of file diff --git a/clients/client-rust/BUILD b/clients/client-rust/BUILD new file mode 100644 index 0000000..456f2a4 --- /dev/null +++ b/clients/client-rust/BUILD @@ -0,0 +1,11 @@ +load("@rules_rust//rust:defs.bzl", "rust_library") + +rust_library( + name = "vexilla_client", + + # Specifies the source files for the library. + srcs = ["src/lib.rs"], + + # Specifies the Rust edition to use for this library. + edition = "2021", +) diff --git a/clients/client-rust/README.md b/clients/client-rust/README.md index 2cf8042..978cb4a 100644 --- a/clients/client-rust/README.md +++ b/clients/client-rust/README.md @@ -28,6 +28,36 @@ let mut flags = client.fetch_flags_blocking("features.json"); client.set_flags(flags); ``` +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types rust REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + ### Usage Use the created client to check if a feature `Should` be on. @@ -52,7 +82,7 @@ if client.should(FEATURE_NAME) { ## What are Feature Flags? -Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases such as mobile applications, the redeploy could take up to a week. +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. See more about them here: @@ -63,31 +93,29 @@ Feature Flags are also a fundamental building block for things such as A/B testi ## How does it work? -1. You configure the Config UI with your hosting credentials. These are stored in LocalStorage. Your credentials should have a limited scope of permissions. - -2. You add environments to the Config UI. +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). -3. Then you add features. These can be a toggle or a gradual rollout. - -4. Then you upload the json to your static hosting provider. You can also download ot copy the JSON to your clipboard for other uses. - -5. Your applications include a client library as a dependency and the client consumes the JSON config. +## Contributing -6. Finally your application uses the client you created to determine if a feature `Should` be on. +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. -## Contributing +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). ## Support -If you are having issues, please open a Github Issue on the relevant repo. (client, app, docs, etc.). +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). ## Sponsors No sponsors yet. This could be a link and icon for **your** company here. -## LICENSE - MIT +## LICENSE + +MIT -Copyright 2021 Vexilla +Copyright 2023 Vexilla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/clients/client-rust/README.toml b/clients/client-rust/README.toml index 3a94b65..7bbac8b 100644 --- a/clients/client-rust/README.toml +++ b/clients/client-rust/README.toml @@ -4,18 +4,16 @@ InstallInstructions = ''' Add the client to your imports. ```rust -vexilla_client = "0.0.1" +vexilla_client = "1.x.x" ``` ''' CustomInstanceHash = "custom_instance_hash" -FetchFlags = "fetch_flags_blocking" +SyncFlags = "sync_flags_blocking" SetupSnippet = ''' ```rust let mut client = VexillaClient::new("dev", "https://BUCKET_NAME.s3-website-AWS_REGION.amazonaws.com", user_id); -let mut flags = client.fetch_flags_blocking("features.json"); - -client.set_flags(flags); +client.sync_flags_blocking("features.json"); ``` ''' Should = "Should" diff --git a/scripts/README.mustache b/scripts/README.mustache new file mode 100644 index 0000000..12885ba --- /dev/null +++ b/scripts/README.mustache @@ -0,0 +1,102 @@ +# Vexilla Client - {{LanguageDisplayName}} + +This is the {{LanguageDisplayName}} client library for Vexilla, a static file based feature flag system. + +## Getting Started + +To get started is easy. + +### Installation + +{{InstallInstructions}} + +### Setup + +You will need to create a Client within your app. This optionally takes in the `{{CustomInstanceHash}}` for use with gradual rollout. + +After creation, call `{{SyncFlags}}`. This can be chained from the constructor since it returns the client instance. + +{{SetupSnippet}} + +### Generate Types (Optional) + +We have created a tool to generate types for usage in your code. It will crawl your JSON structures and create consts or enums to help prevent typos and other "magic string" related issues. You just need to pass the URL of the JSON file where it is hosted. + +#### NPM + +To use the tool, you can run it directly from NPM. + +``` +npx vexilla types {{LanguageName}} REMOTE_JSON_URL +``` + +#### Automatic Install Script + +You can also use a precompiled binary for your platform. This install script will automatically choose the right binary for you: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +The install script also accepts a target install path: + +``` +curl -o- -s https://raw.githubusercontent.com/vexilla/vexilla/main/install.sh | bash +``` + +#### Manual Installation + +If you prefer to download the binary manually you can get it from the releases section in Github, [https://github.com/vexilla/vexilla/releases](https://github.com/vexilla/vexilla/releases) + +### Usage + +Use the created client to check if a feature `{{Should}}` be on. + +{{UsageSnippet}} + +### Full Example + +{{Example}} + +## What are Feature Flags? + +Feature flags are useful for enabling or disabling parts of your application without having to redeploy. In some cases, such as mobile applications, the redeploy could take up to a week. + +See more about them here: + +- [https://featureflags.io](https://featureflags.io) +- [https://en.wikipedia.org/wiki/Feature_toggle](https://en.wikipedia.org/wiki/Feature_toggle) + +Feature Flags are also a fundamental building block for things such as A/B testing. + +## How does it work? + +The process is simple but has several steps to get up and running. Please see our in-depth guides in our [documentation](https://vexilla.dev/documentation). + +## Contributing + +Would you like to contribute to this client SDK? There are many ways you can help. Reporting issues or creating PRs are the most obvious. Helping triage the issues and PRs of others would also be a huge help. Being a vibrant member of the community on [Discord](https://discord.gg/GbJu3d93TC) is another way to help out. + +If you would like to contribute to the app, docs, or other parts of the project, please go see our [Contribution Guide](https://vexilla.dev/documentation/contributing). + +## Support + +Have you run into a bug? Is there a feature you feel is missing? Feel free to create a [GitHub Issue](https://github.com/vexilla/vexilla/issues). + +Another way to get support or help is to reach out in our [Discord community](https://discord.gg/GbJu3d93TC). + +## Sponsors + +No sponsors yet. This could be a link and icon for **your** company here. + +## LICENSE + +MIT + +Copyright 2023 Vexilla + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/scripts/build-client-readmes.ts b/scripts/build-client-readmes.ts new file mode 100644 index 0000000..74d73da --- /dev/null +++ b/scripts/build-client-readmes.ts @@ -0,0 +1,45 @@ +import chalk from "chalk"; +import fs from "fs"; +import path from "path"; +import toml from "toml"; +import mustache from "mustache"; + +const readmeTemplate = fs.readFileSync( + path.resolve(__dirname, "README.mustache"), + { encoding: "utf8" } +); + +const dir = fs.opendirSync(path.resolve(__dirname, "../clients")); + +let dirEntry = dir.readSync(); + +while (dirEntry) { + if (!dirEntry.isDirectory()) { + continue; + } + + if (!dirEntry.name.startsWith("client-")) { + continue; + } + + const tomlData = fs.readFileSync(path.resolve(dirEntry.path, "README.toml"), { + encoding: "utf8", + }); + + const parsedToml = toml.parse(tomlData); + + const templatedReadme = mustache.render( + readmeTemplate, + parsedToml, + undefined, + { + escape: function (value) { + return value; + }, + } + ); + + fs.writeFileSync(path.resolve(dirEntry.path, "README.md"), templatedReadme); + + dirEntry = dir.readSync(); +} diff --git a/scripts/build-clients.ts b/scripts/build-clients.ts deleted file mode 100644 index e69de29..0000000 diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..5dea083 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "include": ["scripts/**/*"], + "compilerOptions": { + "declaration": true, + "esModuleInterop": true + } +}