{"id":16800738,"url":"https://github.com/houseme/bytedance","last_synced_at":"2025-04-11T00:31:53.910Z","repository":{"id":184998138,"uuid":"672797861","full_name":"houseme/bytedance","owner":"houseme","description":"Byte Mini Program,Douyin Mini Program bytedance microapp sdk","archived":false,"fork":false,"pushed_at":"2025-04-07T04:09:07.000Z","size":206,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T05:20:38.753Z","etag":null,"topics":["bytedance","bytedance-microapp","douyin","douyin-microapp","microapp","microapp-sdk"],"latest_commit_sha":null,"homepage":"https://houseme.github.io/bytedance/","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/houseme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"houseme","issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/houseme"]}},"created_at":"2023-07-31T07:32:45.000Z","updated_at":"2025-04-07T04:09:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5a7bf13-8cc9-4cfa-b456-9c371ef4b295","html_url":"https://github.com/houseme/bytedance","commit_stats":null,"previous_names":["houseme/bytedance"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fbytedance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fbytedance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fbytedance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fbytedance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houseme","download_url":"https://codeload.github.com/houseme/bytedance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322263,"owners_count":21084334,"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":["bytedance","bytedance-microapp","douyin","douyin-microapp","microapp","microapp-sdk"],"created_at":"2024-10-13T09:34:51.628Z","updated_at":"2025-04-11T00:31:53.852Z","avatar_url":"https://github.com/houseme.png","language":"Go","funding_links":["https://liberapay.com/houseme","https://paypal.me/houseme"],"categories":[],"sub_categories":[],"readme":"# Bytedance Open Platform SDK\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/houseme/bytedance)](https://goreportcard.com/report/github.com/houseme/bytedance)\n[![Go Reference](https://pkg.go.dev/badge/github.com/houseme/bytedance.svg)](https://pkg.go.dev/github.com/houseme/bytedance)\n[![Bytedance CI](https://github.com/houseme/bytedance/actions/workflows/go.yml/badge.svg)](https://github.com/houseme/bytedance/actions/workflows/go.yml)\n[![License](https://img.shields.io/github/license/houseme/bytedance.svg?style=flat)](https://github.com/houseme/bytedance)\n![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/houseme/bytedance/main)\n\nBytedance Mini Program Douyin Mini Program bytedance microapp SDK\n\n### Installation\n\nEnter your repo. directory and execute following command:\n\n```bash\ngo get -u -v github.com/houseme/bytedance@main\n```\n\n### Limitation\n\n```\ngolang version \u003e= 1.20\n```\n\n### Usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \n    \"github.com/houseme/bytedance\"\n    \"github.com/houseme/bytedance/config\"\n    \"github.com/houseme/bytedance/credential\"\n    \"github.com/houseme/bytedance/utility/cache\"\n    \"github.com/houseme/bytedance/utility/logger\"\n    \"github.com/houseme/bytedance/utility/request\"\n)\n\nfunc main() {\n    var ctx = context.Background()\n    wc := bytedance.New(ctx)\n    cfg := config.New(\n        ctx,\n        config.WithClientKey(\"\"),\n        config.WithClientSecret(\"\"),\n        config.WithRedirectURL(\"\"),\n        config.WithLogger(logger.NewDefaultLogger()),\n        config.WithRequest(request.NewDefaultRequest()),\n        config.WithCache(cache.NewRedis(ctx, cache.NewDefaultRedisOpts())),\n        config.WithScopes(\"\"),\n        config.WithSalt(\"\"),\n    )\n    \n    // 获取小程序实例\n    miniProgram, err := wc.MiniProgram(ctx, cfg)\n    if err != nil {\n        panic(err)\n    }\n    auth := miniProgram.GetAuthorize()\n    // 获取用户授权\n    var accessToken credential.AccessToken\n    if accessToken, err = auth.GetAccessToken(ctx, \"code\"); err != nil {\n        panic(err)\n    }\n    fmt.Println(accessToken)\n    \n    // 创建二维码\n    qrcode := miniProgram.GetQrcode()\n    \n    // 获取小程序码\n    schema := miniProgram.GetSchema()\n    \n    // 获取链接\n    link := miniProgram.GetLink()\n\n}\n\n```\n\n### License\n\n`Bytedance` is licensed under the [Apache License Version 2.0](LICENSE), 100% free and open-source, forever.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseme%2Fbytedance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhouseme%2Fbytedance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseme%2Fbytedance/lists"}