diff --git a/api_proto/common.pb.go b/api_proto/common.pb.go
new file mode 100644
index 0000000..b98c610
--- /dev/null
+++ b/api_proto/common.pb.go
@@ -0,0 +1,281 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.17.3
+// source: api_proto/common.proto
+
+package api_proto
+
+import (
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Environment_Browser int32
+
+const (
+	Environment_BROWSER_UNKNOWN  Environment_Browser = 0
+	Environment_BROWSER_CHROMIUM Environment_Browser = 1
+	Environment_BROWSER_GECKO    Environment_Browser = 2
+)
+
+// Enum value maps for Environment_Browser.
+var (
+	Environment_Browser_name = map[int32]string{
+		0: "BROWSER_UNKNOWN",
+		1: "BROWSER_CHROMIUM",
+		2: "BROWSER_GECKO",
+	}
+	Environment_Browser_value = map[string]int32{
+		"BROWSER_UNKNOWN":  0,
+		"BROWSER_CHROMIUM": 1,
+		"BROWSER_GECKO":    2,
+	}
+)
+
+func (x Environment_Browser) Enum() *Environment_Browser {
+	p := new(Environment_Browser)
+	*p = x
+	return p
+}
+
+func (x Environment_Browser) String() string {
+	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Environment_Browser) Descriptor() protoreflect.EnumDescriptor {
+	return file_api_proto_common_proto_enumTypes[0].Descriptor()
+}
+
+func (Environment_Browser) Type() protoreflect.EnumType {
+	return &file_api_proto_common_proto_enumTypes[0]
+}
+
+func (x Environment_Browser) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Environment_Browser.Descriptor instead.
+func (Environment_Browser) EnumDescriptor() ([]byte, []int) {
+	return file_api_proto_common_proto_rawDescGZIP(), []int{0, 0}
+}
+
+type Environment_VersionChannel int32
+
+const (
+	Environment_CHANNEL_UNKNOWN Environment_VersionChannel = 0
+	Environment_CHANNEL_STABLE  Environment_VersionChannel = 1
+	Environment_CHANNEL_BETA    Environment_VersionChannel = 2
+)
+
+// Enum value maps for Environment_VersionChannel.
+var (
+	Environment_VersionChannel_name = map[int32]string{
+		0: "CHANNEL_UNKNOWN",
+		1: "CHANNEL_STABLE",
+		2: "CHANNEL_BETA",
+	}
+	Environment_VersionChannel_value = map[string]int32{
+		"CHANNEL_UNKNOWN": 0,
+		"CHANNEL_STABLE":  1,
+		"CHANNEL_BETA":    2,
+	}
+)
+
+func (x Environment_VersionChannel) Enum() *Environment_VersionChannel {
+	p := new(Environment_VersionChannel)
+	*p = x
+	return p
+}
+
+func (x Environment_VersionChannel) String() string {
+	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Environment_VersionChannel) Descriptor() protoreflect.EnumDescriptor {
+	return file_api_proto_common_proto_enumTypes[1].Descriptor()
+}
+
+func (Environment_VersionChannel) Type() protoreflect.EnumType {
+	return &file_api_proto_common_proto_enumTypes[1]
+}
+
+func (x Environment_VersionChannel) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Environment_VersionChannel.Descriptor instead.
+func (Environment_VersionChannel) EnumDescriptor() ([]byte, []int) {
+	return file_api_proto_common_proto_rawDescGZIP(), []int{0, 1}
+}
+
+type Environment struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Browser        Environment_Browser        `protobuf:"varint,1,opt,name=browser,proto3,enum=Environment_Browser" json:"browser,omitempty"`
+	Version        string                     `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
+	VersionChannel Environment_VersionChannel `protobuf:"varint,3,opt,name=version_channel,json=versionChannel,proto3,enum=Environment_VersionChannel" json:"version_channel,omitempty"`
+}
+
+func (x *Environment) Reset() {
+	*x = Environment{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_api_proto_common_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Environment) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Environment) ProtoMessage() {}
+
+func (x *Environment) ProtoReflect() protoreflect.Message {
+	mi := &file_api_proto_common_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Environment.ProtoReflect.Descriptor instead.
+func (*Environment) Descriptor() ([]byte, []int) {
+	return file_api_proto_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Environment) GetBrowser() Environment_Browser {
+	if x != nil {
+		return x.Browser
+	}
+	return Environment_BROWSER_UNKNOWN
+}
+
+func (x *Environment) GetVersion() string {
+	if x != nil {
+		return x.Version
+	}
+	return ""
+}
+
+func (x *Environment) GetVersionChannel() Environment_VersionChannel {
+	if x != nil {
+		return x.VersionChannel
+	}
+	return Environment_CHANNEL_UNKNOWN
+}
+
+var File_api_proto_common_proto protoreflect.FileDescriptor
+
+var file_api_proto_common_proto_rawDesc = []byte{
+	0x0a, 0x16, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x76,
+	0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x77,
+	0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x45, 0x6e, 0x76, 0x69,
+	0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x52,
+	0x07, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73,
+	0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
+	0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x68,
+	0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x45, 0x6e,
+	0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
+	0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
+	0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x47, 0x0a, 0x07, 0x42, 0x72, 0x6f, 0x77,
+	0x73, 0x65, 0x72, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x5f, 0x55,
+	0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x52, 0x4f, 0x57,
+	0x53, 0x45, 0x52, 0x5f, 0x43, 0x48, 0x52, 0x4f, 0x4d, 0x49, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x11,
+	0x0a, 0x0d, 0x42, 0x52, 0x4f, 0x57, 0x53, 0x45, 0x52, 0x5f, 0x47, 0x45, 0x43, 0x4b, 0x4f, 0x10,
+	0x02, 0x22, 0x4b, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e,
+	0x6e, 0x65, 0x6c, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x55,
+	0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x48, 0x41, 0x4e,
+	0x4e, 0x45, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c,
+	0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, 0x5f, 0x42, 0x45, 0x54, 0x41, 0x10, 0x02, 0x42, 0x2e,
+	0x5a, 0x2c, 0x67, 0x6f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x61, 0x76, 0x6d, 0x39,
+	0x39, 0x39, 0x36, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x77, 0x70, 0x74, 0x2d, 0x73, 0x65,
+	0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_api_proto_common_proto_rawDescOnce sync.Once
+	file_api_proto_common_proto_rawDescData = file_api_proto_common_proto_rawDesc
+)
+
+func file_api_proto_common_proto_rawDescGZIP() []byte {
+	file_api_proto_common_proto_rawDescOnce.Do(func() {
+		file_api_proto_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_common_proto_rawDescData)
+	})
+	return file_api_proto_common_proto_rawDescData
+}
+
+var file_api_proto_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_api_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_api_proto_common_proto_goTypes = []interface{}{
+	(Environment_Browser)(0),        // 0: Environment.Browser
+	(Environment_VersionChannel)(0), // 1: Environment.VersionChannel
+	(*Environment)(nil),             // 2: Environment
+}
+var file_api_proto_common_proto_depIdxs = []int32{
+	0, // 0: Environment.browser:type_name -> Environment.Browser
+	1, // 1: Environment.version_channel:type_name -> Environment.VersionChannel
+	2, // [2:2] is the sub-list for method output_type
+	2, // [2:2] is the sub-list for method input_type
+	2, // [2:2] is the sub-list for extension type_name
+	2, // [2:2] is the sub-list for extension extendee
+	0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_api_proto_common_proto_init() }
+func file_api_proto_common_proto_init() {
+	if File_api_proto_common_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_api_proto_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Environment); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_api_proto_common_proto_rawDesc,
+			NumEnums:      2,
+			NumMessages:   1,
+			NumExtensions: 0,
+			NumServices:   0,
+		},
+		GoTypes:           file_api_proto_common_proto_goTypes,
+		DependencyIndexes: file_api_proto_common_proto_depIdxs,
+		EnumInfos:         file_api_proto_common_proto_enumTypes,
+		MessageInfos:      file_api_proto_common_proto_msgTypes,
+	}.Build()
+	File_api_proto_common_proto = out.File
+	file_api_proto_common_proto_rawDesc = nil
+	file_api_proto_common_proto_goTypes = nil
+	file_api_proto_common_proto_depIdxs = nil
+}
