{"id":20789251,"url":"https://github.com/instabug/instabug-grpc","last_synced_at":"2025-06-23T00:07:10.924Z","repository":{"id":40303762,"uuid":"446853177","full_name":"Instabug/Instabug-gRPC","owner":"Instabug","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-06T14:40:21.000Z","size":37,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-20T07:04:09.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Instabug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-01-11T14:25:14.000Z","updated_at":"2022-02-09T08:01:52.000Z","dependencies_parsed_at":"2023-12-06T12:35:48.709Z","dependency_job_id":"0dc0fcff-ab39-4276-9a43-5e37de2eaef9","html_url":"https://github.com/Instabug/Instabug-gRPC","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.17647058823529416","last_synced_commit":"6055ef9bbd7d5db5be2144b783c5df41d9614438"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Instabug/Instabug-gRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Instabug%2FInstabug-gRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Instabug%2FInstabug-gRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Instabug%2FInstabug-gRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Instabug%2FInstabug-gRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Instabug","download_url":"https://codeload.github.com/Instabug/Instabug-gRPC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Instabug%2FInstabug-gRPC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261386809,"owners_count":23150873,"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":[],"created_at":"2024-11-17T15:21:35.491Z","updated_at":"2025-06-23T00:07:05.910Z","avatar_url":"https://github.com/Instabug.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instabug-gRPC\nThis is a destination for Instabug to support logging gRPC requests.\n\n## Compatibility\nThere's `Instabug_gRPC_Swift` which is a Swift framework and intended to be used with Swift projects. And there's `Instabug_gRPC_Objc` which intended to be used with Objective-C projects\n\n## Installation\n\nAdd pod `Instabug-gRPC-Swift` or pod `'Instabug-gRPC-ObjC'` to your `podfile`\n\n## Requirements\n\niOS version \u003e= 10.0\nInstabug version \u003e= 10.11.8\n\n## Swift Example\n1. Make sure you import our destination first: `import Instabug_gRPC_Swift`\n2. Create Interceptor factory that confirms to the interceptor factory protocol that you have in your .grpc file\n3. Make sure to return new instance of our Interceptor `InstabugClientInterceptor()` in the methods that you need us to log\n4. Conform on `InstabugGRPCDataProtocol` for request and response models which requires that you expose your models as `Data`\n5. You can convert your model to `Data` by conforming to `Encodable`\n6. You can pass the port optional in `InstabugClientInterceptor` as `InstabugClientInterceptor(port:)` to see it on the dashboard\n \n### Sample code \n\n```\nclass ExampleClientInterceptorFactory: Echo_EchoClientInterceptorFactoryProtocol {\n  // Returns an array of interceptors to use for the 'Get' RPC.\n  func makeGetInterceptors() -\u003e [ClientInterceptor\u003cEcho_EchoRequest, Echo_EchoResponse\u003e] {\n    return [InstabugClientInterceptor()]\n  }\n\n  // Returns an array of interceptors to use for the 'Expand' RPC.\n  func makeExpandInterceptors() -\u003e [ClientInterceptor\u003cEcho_EchoRequest, Echo_EchoResponse\u003e] {\n    return [InstabugClientInterceptor()]\n  }\n\n  // Returns an array of interceptors to use for the 'Collect' RPC.\n  func makeCollectInterceptors() -\u003e [ClientInterceptor\u003cEcho_EchoRequest, Echo_EchoResponse\u003e] {\n    return [InstabugClientInterceptor()]\n  }\n\n  // Returns an array of interceptors to use for the 'Update' RPC.\n  func makeUpdateInterceptors() -\u003e [ClientInterceptor\u003cEcho_EchoRequest, Echo_EchoResponse\u003e] {\n    return [InstabugClientInterceptor()]\n  }\n}\n\nextension GrpcAutomation_RepeaterRequest: InstabugGRPCDataProtocol, Encodable {\n    enum CodingKeys: String, CodingKey {\n        case message, unknownFields\n    }\n    \n    public func encode(to encoder: Encoder) throws {\n        var container = encoder.container(keyedBy: CodingKeys.self)\n        try container.encode(message, forKey: .message)\n    }\n    \n    public var gRPCRequestData: Data? {\n        let jsonEncoder = JSONEncoder()\n        let data = try? jsonEncoder.encode(self)\n        return data\n    }\n```\n\nAnd finally pass `ExampleClientInterceptorFactory()` to your client like this\n\n\n```\nlet client = Echo_EchoClient(channel: channel, interceptors: ExampleClientInterceptorFactory())\n```\n\n## ObjectiveC Example\n1. Create an array of `GRPCInterceptorFactory`\n2. Create a class that conforms to `GRPCInterceptorFactory` protocol\n\n\t```\n\t@interface GRPCFactory : NSObject \u003cGRPCInterceptorFactory\u003e\n\t```\n\n3. Override `createInterceptorWithManager` in `GRPCFactory` and return `InstabugClientInterceptor `\n\n\t```\n\t- (nonnull GRPCInterceptor *)createInterceptorWithManager:(nonnull GRPCInterceptorManager *)interceptorManager {\n\t    InstabugClientInterceptor *interceptor = [[InstabugClientInterceptor alloc] initWithInterceptorManager:interceptorManager dispatchQueue:dispatch_get_main_queue()];\n\t    return  interceptor;\n\t}\n\t```\n4. Create a new instance from `GRPCFactory` then add it to the interceptors array\n5. Create a new instance of `GRPCInterceptorManager` with the `interceptorFactories` array\n6. Then pass the manager to the factory instance then \n7. Finally pass `interceptorFactories` to `options.interceptorFactories`\n\n### Sample code\n\n```\n    GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];\n    \n    NSMutableArray\u003cid\u003cGRPCInterceptorFactory\u003e\u003e *interceptorFactories = [NSMutableArray new];\n  \n    GRPCFactory *factory = [GRPCFactory new];\n    [interceptorFactories addObject:factory];\n    GRPCInterceptorManager *manager = [[GRPCInterceptorManager alloc] initWithFactories:interceptorFactories\n                                                                    previousInterceptor:nil\n                                                                            transportID:GRPCDefaultTransportImplList.core_insecure];\n\n    [factory createInterceptorWithManager:manager];\n    options.interceptorFactories = interceptorFactories;\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstabug%2Finstabug-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstabug%2Finstabug-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstabug%2Finstabug-grpc/lists"}