{"record":{"id":"0079495de46f3b75","repo":"refinedev/refine","slug":"getapiurl-method-is-not-implemented-on-refine-ap","errorCode":null,"errorMessage":"'getApiUrl' method is not implemented on refine-appwrite data provider.","messagePattern":"'getApiUrl' method is not implemented on refine-appwrite data provider\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/appwrite/src/dataProvider.ts","lineNumber":194,"sourceCode":"        ids.map((id) =>\n          database.updateDocument<any>(\n            databaseId,\n            resource,\n            id.toString(),\n            variables as unknown as object,\n            [...readPermissions, ...writePermissions],\n          ),\n        ),\n      );\n      return {\n        data: data.map(({ $id, ...restData }) => ({\n          id: $id,\n          ...restData,\n        })),\n      } as any;\n    },\n    getApiUrl: () => {\n      throw Error(\n        \"'getApiUrl' method is not implemented on refine-appwrite data provider.\",\n      );\n    },\n    custom: () => {\n      throw Error(\n        \"'custom' method is not implemented on refine-appwrite data provider.\",\n      );\n    },\n  };\n};\n","sourceCodeStart":176,"sourceCodeEnd":205,"githubUrl":"https://github.com/refinedev/refine/blob/779d52a20e29b0307ac0df04d135beba434370dc/packages/appwrite/src/dataProvider.ts#L176-L205","documentation":"The Appwrite data provider throws on the optional `getApiUrl` method because Appwrite's SDK talks to a per-project endpoint via its client, not a single REST base URL usable generically. Anything calling `dataProvider.getApiUrl()` on a refine-appwrite provider gets this thrown Error.","triggerScenarios":"Invoking `getApiUrl()` on the refine-appwrite data provider — commonly from an authProvider or upload helper copied from REST-provider examples, or generic code that assumes every provider exposes an API URL.","commonSituations":"Combining Appwrite as data provider with a custom auth flow that builds URLs from getApiUrl; refactoring from simple-rest to appwrite without removing getApiUrl usage.","solutions":["Guard with `typeof dataProvider.getApiUrl === 'function'` before calling","Use your configured Appwrite endpoint (the Client set with setEndpoint/setProject) instead of getApiUrl","Move URL-dependent features to a provider that implements them, keeping appwrite only for its resources"],"exampleFix":"// before\nconst base = dataProvider.getApiUrl();\n// after\nconst base =\n  typeof dataProvider.getApiUrl === 'function'\n    ? dataProvider.getApiUrl()\n    : process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!;","handlingStrategy":"type-guard","validationCode":"if (typeof dataProvider.getApiUrl !== 'function') {\n  apiUrl = process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!;\n}","typeGuard":"const supportsGetApiUrl = (dp: unknown): dp is { getApiUrl: () => string } =>\n  typeof (dp as any)?.getApiUrl === 'function';","tryCatchPattern":"try {\n  url = dataProvider.getApiUrl();\n} catch {\n  url = process.env.APPWRITE_ENDPOINT!;\n}","preventionTips":["Read provider docs for which optional methods are implemented","Centralize endpoint constants in env vars instead of deriving from getApiUrl"],"tags":["appwrite","data-provider","get-api-url","not-implemented","refine"],"backgroundTag":"provider-method-not-implemented","analyzedSha":"779d52a20e29b0307ac0df04d135beba434370dc","analyzedAt":"2026-08-27T11:15:25.854Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}