{"id":19541316,"url":"https://github.com/wingify/vwo-go-sdk","last_synced_at":"2025-04-26T17:30:44.174Z","repository":{"id":47897126,"uuid":"269013087","full_name":"wingify/vwo-go-sdk","owner":"wingify","description":"[DEPRECATED] VWO Go SDK for server-side testing","archived":false,"fork":false,"pushed_at":"2025-03-25T14:06:17.000Z","size":232,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-04T16:12:14.601Z","etag":null,"topics":["go","go-sdk","server-side","server-side-rendering","vwo","vwo-go-sdk"],"latest_commit_sha":null,"homepage":"https://developers.vwo.com/docs/fullstack-overview","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wingify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-03T06:56:59.000Z","updated_at":"2025-03-25T14:06:22.000Z","dependencies_parsed_at":"2024-06-20T00:04:46.738Z","dependency_job_id":"54325e41-402a-4716-9c00-f6cd345bc559","html_url":"https://github.com/wingify/vwo-go-sdk","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-go-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-go-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-go-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-go-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wingify","download_url":"https://codeload.github.com/wingify/vwo-go-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025559,"owners_count":21524824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","go-sdk","server-side","server-side-rendering","vwo","vwo-go-sdk"],"created_at":"2024-11-11T03:09:37.906Z","updated_at":"2025-04-26T17:30:44.167Z","avatar_url":"https://github.com/wingify.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚠️ [DEPRECATED] VWO GO SDK\n\n**⚠️ This project is no longer actively developed. ⚠️**\n\n**✅ We are only fixing critical bugs and security issues.**\n\n**❌ No new features, enhancements, or non-critical updates will be added.**\n\n#### Switch to *VWO Feature Management \u0026 Experimentation(FME)* – The Better Alternative! 🚀\n\nVWO’s FME product empowers teams to seamlessly test, release, optimize, and roll back features across their entire tech stack while minimizing risk and maximizing business impact.\n\n* Check out FME developer documentation [here](https://developers.vwo.com/v2/docs/fme-overview).\n* Check [this](https://developers.vwo.com/v2/docs/sdks-release-info ) for the list of all FME-supported SDKs.\n\n**💡 Need Help?**\nFor migration assistance or any questions, contact us at [support@vwo.com](support@vwo.com)\n\n------\n\n[![CI](https://github.com/wingify/vwo-go-sdk/workflows/CI/badge.svg?branch=master)](https://github.com/wingify/vwo-go-sdk/actions?query=workflow%3ACI)\n![Size in Bytes](https://img.shields.io/github/languages/code-size/wingify/vwo-go-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![codecov](https://codecov.io/gh/wingify/vwo-go-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/wingify/vwo-go-sdk)\n\nThis open source library allows you to A/B Test your Website at server-side.\n\n## Requirements\n\n- Works with Go 1.11.4+\n\n## Installation\n\n```go\ngo get \"github.com/wingify/vwo-go-sdk\"\n```\n\n## Basic usage\n\n**Importing and Instantiation**\n\n```go\nimport vwo \"github.com/wingify/vwo-go-sdk\"\nimport \"github.com/wingify/vwo-go-sdk/pkg/api\"\n\n// Get SettingsFile\nsettingsFile := vwo.GetSettingsFile(\"accountID\", \"SDKKey\")\n\n// Default instance of VwoInstance\nvwoClientInstance, err := vwo.Launch(settingsFile)\nif err != nil {\n\t//handle err\n}\n\n// Instance with custom options\nvwoClientInstance, err := vwo.Launch(settingsFile, api.WithDevelopmentMode())\nif err != nil {\n\t//handle err\n}\n\n// Activate API\n// With Custom Variables\noptions := make(map[string]interface{})\noptions[\"customVariables\"] = map[string]interface{}{\"a\": \"x\"}\noptions[\"variationTargetingVariables\"] = map[string]interface{}{\"a\": \"x\"}\noptions[\"revenueValue\"] = 12\nvariationName = vwoClientInstance.Activate(campaignKey, userID, options)\n\n// Without Custom Variables\nvariationName = vwoClientInstance.Activate(campaignKey, userID, nil)\n\n\n// GetVariation\n// With Custom Variables\noptions := make(map[string]interface{})\noptions[\"customVariables\"] = map[string]interface{}{\"a\": \"x\"}\nvariationName = vwoClientInstance.GetVariationName(campaignKey, userID, options)\n\n//Without Custom Variables\nvariationName = vwoClientInstance.GetVariationName(campaignKey, userID, nil)\n\n\n// Track API\n// With Custom Variables\noptions := make(map[string]interface{})\noptions[\"customVariables\"] = map[string]interface{}{\"a\": \"x\"}\nisSuccessful = vwoClientInstance.Track(campaignKey, userID, goalIdentifier, options)\n\n// With Revenue Value\noptions := make(map[string]interface{})\noptions[\"revenueValue\"] = 12\nisSuccessful = vwoClientInstance.Track(campaignKey, userID, goalIdentifier, options)\n\n// With Custom Variables, Revenue Value, GoalTypeToTrack and ShouldTrackreturningUser\noptions := make(map[string]interface{})\noptions[\"customVariables\"] = map[string]interface{}{\"a\": \"x\"}\noptions[\"revenueValue\"] = 12\n//  Set specific goalType to Track\n//  Available GoalTypes - constants.GoalTypeRevenue, constants.GoalTypeCustom, constants.GoalTypeAll (Default)\noptions[\"goalTypeToTrack\"] = constants.GoalTypeAll\n//  Set if a return user should be tracked, default false\noptions[\"ShouldTrackreturningUser\"] = false\nisSuccessful = vwoInstance.Track(campaignKey, userID, goalIdentifier, options)\n\n// For Goal Conversion in Multiple Campaign\n// campaignKeys = []string{\"campaignKey1\", \"campaignKey2\", \"campaignKey3\"}\n// For Goal Conversion in All Possible Campaigns\n// campaignKeys = nil\nisSuccessful = vwoInstance.Track(campaignKeys, userID, goalIdentifier, options)\n\n\n// FeatureEnabled API\n// With Custom Varibles\noptions := make(map[string]interface{})\noptions[\"customVariables\"] = map[string]interface{}{\"a\": \"x\"}\nisSuccessful = vwoClientInstance.IsFeatureEnabled(campaignKey, userID, options)\n\n// Without Custom Variables\nisSuccessful = vwoClientInstance.IsFeatureEnabled(campaignKey, userID, nil)\n\n// GetFeatureVariableValue API\n// With Custom Variables\noptions := make(map[string]interface{})\noptions[\"customVariables\"] = map[string]interface{}{\"a\": \"x\"}\nvariableValue = vwoClientInstance.GetFeatureVariableValue(campaignKey, variableKey, userID, options)\n\n// Without Custom Variables\nvariableValue = vwoClientInstance.GetFeatureVariableValue(campaignKey, variableKey, userID, nil)\n\n// Push API\nisSuccessful = vwoClientInstance.Push(tagKey, tagValue, userID)\n```\n\n**User Storage**\n\n```go\nimport vwo \"github.com/wingify/vwo-go-sdk/\"\nimport \"github.com/wingify/vwo-go-sdk/pkg/api\"\nimport \"github.com/wingify/vwo-go-sdk/pkg/schema\"\n\n// declare UserStorage interface with the following Get \u0026 Set function signature\ntype UserStorage interface{\n    Get(userID, campaignKey string) UserData\n    Set(string, string, string, string)\n}\n\n// declare a UserStorageData struct to implement UserStorage interface\ntype UserStorageData struct{}\n\n// Get method to fetch user variation from storage\nfunc (us *UserStorageData) Get(userID, campaignKey string) schema.UserData {\n    //Example code showing how to get userData  from DB\n    userData, ok := userDatas[campaignKey]\n    if ok {\n\t\tfor _, userdata := range userData {\n\t\t\tif userdata.UserID == userID {\n\t\t\t\treturn userdata\n\t\t\t}\n\t\t}\n    }\n    /*\n    // UserData  struct\n    type UserData struct {\n\t\tUserID         string\n\t\tCampaignKey    string\n\t\tVariationName  string\n\t\tGoalIdentifier string\n\t}\n    */\n\treturn schema.UserData{}\n}\n\n// Set method to save user variation to storage\nfunc (us *UserStorageData) Set(userID, campaignKey, variationName, goalIdentifer string) {\n    //Example code showing how to store userData in DB\n    userdata := schema.UserData{\n\t\tUserID:        userID,\n\t\tCampaignKey:   campaignKey,\n\t\tVariationName: variationName,\n\t\tGoalIdentifier: goalIdentifier,\n\t}\n\n\tflag := false\n\tuserData, ok := userDatas[userdata.CampaignKey]\n\tif ok {\n\t\tfor _, user := range userData {\n\t\t\tif user.UserID == userdata.UserID {\n\t\t\t\tflag = true\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tuserDatas[userdata.CampaignKey] = append(userDatas[userdata.CampaignKey], userdata)\n\t\t} else {\n\t\t\tfor i, user := range userData {\n\t\t\t\tif user.UserID == userdata.UserID \u0026\u0026 user.CampaignKey == userdata.CampaignKey {\n\t\t\t\t\tuserData[i].VariationName = userdata.VariationName\n\t\t\t\t\tuserData[i].GoalIdentifier = userdata.GoalIdentifier\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tuserDatas[userdata.CampaignKey] = []schema.UserData{\n\t\t\tuserdata,\n\t\t}\n\t}\n\nfunc main() {\n\tsettingsFile := vwo.GetSettingsFile(\"accountID\", \"SDKKey\")\n\t// create UserStorageData object\n\tstorage := \u0026UserStorageData{}\n\n\tvwoClientInstance, err := vwo.Launch(settingsFile, api.WithStorage(storage))\n\tif err != nil {\n\t\t//handle err\n\t}\n}\n\n```\n\n**Custom Logger**\n\n```go\nimport vwo \"github.com/wingify/vwo-go-sdk\"\nimport \"github.com/wingify/vwo-go-sdk/pkg/api\"\n\n// declare Log interface with the following CustomLog function signature\ntype Log interface {\n\tCustomLog(level, errorMessage string)\n}\n\n// declare a LogS struct to implement Log interface\ntype LogS struct{}\n\n// Get function to handle logs\nfunc (c *LogS) CustomLog(level, errorMessage string) {}\n\nfunc main() {\n\tsettingsFile := vwo.GetSettingsFile(\"accountID\", \"SDKKey\")\n\t// create LogS object\n\tlogger := \u0026LogS{}\n\n\tvwoClientInstance, err := vwo.Launch(settingsFile, api.WithLogger(logger))\n\tif err != nil {\n\t\t//handle err\n\t}\n}\n```\n\n## Demo App\n\n[Example](https://github.com/wingify/vwo-go-sdk-example)\n\n## Documentation\n\nRefer [Official VWO FullStack Documentation](https://developers.vwo.com/reference#fullstack-introduction)\n\n## Local Setup\n\n1. Install dependencies\n\n```bash\ngo get .\n```\n\n2. Configure the environment\n\n```bash\nbash start.sh\n```\n\n## Running Unit Tests\n\n```shell\n./test.sh\n```\n\n## Third-party Resources and Credits\n\nRefer [third-party-attributions.txt](third-party-attribution.txt)\n\n## Contributing\n\nPlease go through our [contributing guidelines](CONTRIBUTING.md)\n\n## Code of Conduct\n\n[Code of Conduct](CODE_OF_CONDUCT.md)\n\n## License\n\n[Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-go-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwingify%2Fvwo-go-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-go-sdk/lists"}